unary minus operator applied to unsigned type, result still unsigned



Micrsoft's compiler gives the warning in the Subject when compiling
various GTk+ files. I have previously ignored them, but now I thought
maybe it's best to ask if they might be a sign of some bugs lurking in
the code...

For instance, the following lines in gtktext.c cause that warning:
(line numbers from my current win32 codebase, approximate for the CVS
version)

1109:
    move_mark_n (&text->cursor_mark, 
		 -MIN(nchars, text->cursor_mark.index - text->point.index));
  
1491:
  gdk_gc_set_ts_origin (text->bg_gc,
			(- text->first_onscreen_hor_pixel + xthick) % width,
			(- text->first_onscreen_ver_pixel + ythick) % height);

3579:
      scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next)));

3625:
  gint pixels = - text->first_cut_pixels;

3822:
  pixel_height = - text->first_cut_pixels;

--tml



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]