sawfish r4244 - in trunk: . src



Author: jkozicki
Date: Mon Aug  4 14:42:49 2008
New Revision: 4244
URL: http://svn.gnome.org/viewvc/sawfish?rev=4244&view=rev

Log:
Major C part clean up by Christopher Bratusek



Modified:
   trunk/ChangeLog
   trunk/src/cursors.c
   trunk/src/display.c
   trunk/src/events.c
   trunk/src/fonts.c
   trunk/src/frames.c
   trunk/src/functions.c
   trunk/src/gradient.c
   trunk/src/images.c
   trunk/src/keys.c
   trunk/src/keys.h
   trunk/src/libclient.c
   trunk/src/pixmap-cache.c
   trunk/src/property-cache.c
   trunk/src/sawmill.h
   trunk/src/sawmill_subrs.h
   trunk/src/server.c
   trunk/src/session.c
   trunk/src/stacking-list.c
   trunk/src/windows.c
   trunk/src/x.c

Modified: trunk/src/cursors.c
==============================================================================
--- trunk/src/cursors.c	(original)
+++ trunk/src/cursors.c	Mon Aug  4 14:42:49 2008
@@ -203,7 +203,7 @@
 cursor_prin (repv stream, repv obj)
 {
     char buf[256];
-    sprintf (buf, "#<cursor %x>", (u_int) VCURSOR(obj)->cursor);
+    sprintf (buf, "#<cursor %x>", (unsigned int) VCURSOR(obj)->cursor);
     rep_stream_puts (stream, buf, -1, FALSE);
 }
 

Modified: trunk/src/display.c
==============================================================================
--- trunk/src/display.c	(original)
+++ trunk/src/display.c	Mon Aug  4 14:42:49 2008
@@ -64,17 +64,6 @@
 
 /* X error handlers */
 
-static void
-print_error (XErrorEvent *ev)
-{
-    char buf[256];
-    XGetErrorText(dpy, ev->error_code, buf, sizeof (buf));
-    fprintf(stderr, "X Error: %s\n", buf);
-    fprintf(stderr, "  Request Major code: %d\n", ev->request_code);
-    fprintf(stderr, "  Request Minor code: %d\n", ev->minor_code);
-    fprintf(stderr, "  ResourceId 0x%x\n", (u_int)ev->resourceid);
-}
-
 /* General error handler. Probably due to lag between windows being
    killed and us receiving DestroyNotify events */
 static int

Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c	(original)
+++ trunk/src/events.c	Mon Aug  4 14:42:49 2008
@@ -455,7 +455,7 @@
        until the pointer's position has been queried. I should
        check the Xlib manuals about this. */
     if(XQueryPointer(dpy, ev->xmotion.window,
-		     &tmpw, &tmpw, &x, &y, &tmp, &tmp, &tmp))
+		     &tmpw, &tmpw, &x, &y, &tmp, &tmp, (gpointer) &tmp))
     {
 	record_mouse_position (x, y, ev->type, ev->xmotion.window);
     }
@@ -480,7 +480,7 @@
 
 static bool
 update_window_name(Lisp_Window * w, XPropertyEvent xproperty) {
-    u_char *prop;
+    unsigned char *prop;
     Atom actual;
     int format;
     long nitems, bytes_after;
@@ -493,8 +493,8 @@
     if (xproperty.state != PropertyNewValue
         || XGetWindowProperty (dpy, w->id, xproperty.atom,
                                0, 200, False, AnyPropertyType, &actual,
-                               &format, &nitems,
-                               &bytes_after, &prop) != Success
+                               &format, (gpointer) &nitems,
+                               (gpointer) &bytes_after, &prop) != Success
         || actual == None)
         return FALSE;
 
@@ -507,7 +507,7 @@
     tprop.value = prop;
     tprop.encoding = actual;
     tprop.format = format;
-    tprop.nitems = strlen (prop);
+    tprop.nitems = strlen ((gpointer) prop);
 
 #ifdef X_HAVE_UTF8_STRING
     if (actual == xa_compound_text || actual == XA_STRING
@@ -843,7 +843,7 @@
 	       framed at the map request. -- thk */
 	    if (w->frame == 0)
 		fprintf (stderr, "warning: window %#1x has no frame\n",
-			 (long)(w->id));
+			 (uint)(w->id));
 	    Fcall_window_hook (Qmap_notify_hook, rep_VAL(w), Qnil, Qnil);
 	}
     }
@@ -1096,7 +1096,7 @@
     if (w == 0)
     {
 	XWindowChanges xwc;
-	u_int xwcm = (ev->xconfigurerequest.value_mask & 
+	unsigned int xwcm = (ev->xconfigurerequest.value_mask & 
 		      (CWX | CWY | CWWidth | CWHeight
 		       | CWStackMode | CWSibling));
 	xwc.x = ev->xconfigurerequest.x;
@@ -1109,12 +1109,12 @@
     }
     else if (w != 0)
     {
-	u_long mask = ev->xconfigurerequest.value_mask;
+	unsigned long mask = ev->xconfigurerequest.value_mask;
 	repv alist = Qnil;
 	{
 	    /* Is the window shaped? */
 	    int xws, yws, xbs, ybs;
-	    u_int wws, hws, wbs, hbs;
+	    unsigned int wws, hws, wbs, hbs;
 	    int bounding, clip;
 	    XShapeSelectInput (dpy, w->id, ShapeNotifyMask);
 	    XShapeQueryExtents (dpy, w->id, &bounding, &xws, &yws, &wws, &hws,
@@ -1351,7 +1351,7 @@
     while (XCheckWindowEvent (dpy, w, PropertyChangeMask, &ev)) ;
     XSelectInput (dpy, w, PropertyChangeMask | KeyPressMask);
     XChangeProperty (dpy, w, xa_sawmill_timestamp,
-		     XA_STRING, 8, PropModeReplace, "foo", 3);
+		     XA_STRING, 8, PropModeReplace, (gpointer) "foo", 3);
     XSelectInput (dpy, w, KeyPressMask);
     XWindowEvent (dpy, w, PropertyChangeMask, &ev);
 
@@ -1518,7 +1518,7 @@
 	int tmp;
 	int x, y;
 	if(XQueryPointer(dpy, root_window, &tmpw, &tmpw,
-			 &x, &y, &tmp, &tmp, &tmp))
+			 &x, &y, &tmp, &tmp, (gpointer) &tmp))
 	{
 	    record_mouse_position (x, y, -1, 0);
 	}
@@ -1578,7 +1578,7 @@
 {
     Window child, root;
     int win_x, win_y;
-    u_int state;
+    unsigned int state;
 
     XQueryPointer (dpy, root_window, &root, &child,
 		   &current_mouse_x, &current_mouse_y, &win_x, &win_y, &state);

Modified: trunk/src/fonts.c
==============================================================================
--- trunk/src/fonts.c	(original)
+++ trunk/src/fonts.c	Mon Aug  4 14:42:49 2008
@@ -72,8 +72,8 @@
     const char *type;
     bool (*load) (Lisp_Font *f);
     void (*finalize) (Lisp_Font *f);
-    int (*measure) (Lisp_Font *f, u_char *string, size_t length);
-    void (*draw) (Lisp_Font *f, u_char *string, size_t length,
+    int (*measure) (Lisp_Font *f, unsigned char *string, size_t length);
+    void (*draw) (Lisp_Font *f, unsigned char *string, size_t length,
 		  Window id, GC gc, Lisp_Color *fg, int x, int y);
 };
 
@@ -104,13 +104,13 @@
 }
 
 static int
-fontstruct_measure (Lisp_Font *f, u_char *string, size_t length)
+fontstruct_measure (Lisp_Font *f, unsigned char *string, size_t length)
 {
-    return XTextWidth (f->font, string, length);
+    return XTextWidth (f->font, (gpointer) string, length);
 }
 
 static void
-fontstruct_draw (Lisp_Font *f, u_char *string, size_t length,
+fontstruct_draw (Lisp_Font *f, unsigned char *string, size_t length,
 		 Window id, GC gc, Lisp_Color *fg, int x, int y)
 {
     XFontStruct *fs;
@@ -122,7 +122,7 @@
     gcv.font = fs->fid;
     XChangeGC (dpy, gc, GCForeground | GCFont, &gcv);
 
-    XDrawString (dpy, id, gc, x, y, string, length);
+    XDrawString (dpy, id, gc, x, y, (gpointer) string, length);
 }
 
 static const Lisp_Font_Class fontstruct_class = {
@@ -309,17 +309,17 @@
 }
 
 static int
-fontset_measure (Lisp_Font *f, u_char *string, size_t length)
+fontset_measure (Lisp_Font *f, unsigned char *string, size_t length)
 {
 #ifdef X_HAVE_UTF8_STRING
-    return Xutf8TextEscapement (f->font, string, length);
+    return Xutf8TextEscapement (f->font, (gpointer) string, length);
 #else
     return XmbTextEscapement (f->font, string, length);
 #endif
 }
 
 static void
-fontset_draw (Lisp_Font *f, u_char *string, size_t length,
+fontset_draw (Lisp_Font *f, unsigned char *string, size_t length,
 	      Window id, GC gc, Lisp_Color *fg, int x, int y)
 {
     XGCValues gcv;
@@ -327,7 +327,7 @@
     gcv.foreground = fg->pixel;
     XChangeGC (dpy, gc, GCForeground, &gcv);
 #ifdef X_HAVE_UTF8_STRING
-    Xutf8DrawString (dpy, id, f->font, gc, x, y, string, length);
+    Xutf8DrawString (dpy, id, f->font, gc, x, y, (gpointer) string, length);
 #else
     XmbDrawString (dpy, id, f->font, gc, x, y, string, length);
 #endif
@@ -368,7 +368,7 @@
 }
 
 static int
-xft_measure (Lisp_Font *f, u_char *string, size_t length)
+xft_measure (Lisp_Font *f, unsigned char *string, size_t length)
 {
     XGlyphInfo info;
 
@@ -378,7 +378,7 @@
 }
 
 static void
-xft_draw (Lisp_Font *f, u_char *string, size_t length,
+xft_draw (Lisp_Font *f, unsigned char *string, size_t length,
 	  Window id, GC gc, Lisp_Color *fg, int x, int y)
 {
     static XftDraw *draw;
@@ -471,9 +471,9 @@
 
     pango_font_metrics_unref (metrics);
 
-    f->font = fontdesc; // We save the font description, not the font itself!
-                        // That's because it seems we can't recover it perfectly
-                        // later, and the layout routines want a description
+    f->font = fontdesc; /* We save the font description, not the font itself!
+                        That's because it seems we can't recover it perfectly
+                        later, and the layout routines want a description */
 
     return TRUE;
 }
@@ -485,14 +485,14 @@
 }
 
 static int
-pango_measure (Lisp_Font *f, u_char *string, size_t length)
+pango_measure (Lisp_Font *f, unsigned char *string, size_t length)
 {
     PangoLayout *layout;
     PangoRectangle rect;
 
     layout = pango_layout_new (pango_context);
     pango_layout_set_font_description(layout, f->font);
-    pango_layout_set_text (layout, string, length);
+    pango_layout_set_text (layout, (gpointer) string, length);
 
     pango_layout_get_extents (layout, NULL, &rect);
 
@@ -527,7 +527,7 @@
 }
 
 static void
-pango_draw (Lisp_Font *f, u_char *string, size_t length,
+pango_draw (Lisp_Font *f, unsigned char *string, size_t length,
 	    Window id, GC gc, Lisp_Color *fg, int x, int y)
 {
     static XftDraw *draw;
@@ -548,7 +548,7 @@
 
     layout = pango_layout_new (pango_context);
     pango_layout_set_font_description(layout, f->font);
-    pango_layout_set_text (layout, string, length);
+    pango_layout_set_text (layout, (gpointer) string, length);
     iter = pango_layout_get_iter (layout);
 
     do {
@@ -791,7 +791,7 @@
 }
 
 int
-x_text_width (repv font, u_char *string, size_t len)
+x_text_width (repv font, unsigned char *string, size_t len)
 {
     return (*VFONT (font)->class->measure) (VFONT (font), string, len);
 }
@@ -799,7 +799,7 @@
 /* The foreground pixel of GC is undefined after this function returns. */
 void
 x_draw_string (Window id, repv font, GC gc, Lisp_Color *fg_color,
-	       int x, int y, u_char *string, size_t len)
+	       int x, int y, unsigned char *string, size_t len)
 {
     (*VFONT (font)->class->draw) (VFONT (font), string, len,
 				  id, gc, fg_color, x, y);
@@ -817,7 +817,7 @@
     if (font == Qnil)
 	font = global_symbol_value (Qdefault_font);
     rep_DECLARE2(font, FONTP);
-    return rep_MAKE_INT (x_text_width (font, rep_STR(string),
+    return rep_MAKE_INT (x_text_width (font, (gpointer) rep_STR(string),
 				       rep_STRING_LEN(string)));
 }
 

Modified: trunk/src/frames.c
==============================================================================
--- trunk/src/frames.c	(original)
+++ trunk/src/frames.c	Mon Aug  4 14:42:49 2008
@@ -722,7 +722,7 @@
 		length = rep_STRING_LEN(result);
 	    }
 
-	    width = x_text_width (font, rep_STR(string), length);
+	    width = x_text_width (font, (gpointer) rep_STR(string), length);
 	    height = VFONT(font)->ascent + VFONT(font)->descent;
 	}
 
@@ -755,7 +755,7 @@
 	if (IMAGEP(fg))
 	{
 	    XGCValues gcv;
-	    u_long gcv_mask = 0;
+	    unsigned long gcv_mask = 0;
 	    Pixmap fg_pixmap, fg_mask;
 
 	    if (fp->drawn.fg == fg
@@ -831,7 +831,7 @@
 
 	    x_draw_string (fp->id, font, fp->gc, VCOLOR(fg),
 			   x, y + VFONT(font)->ascent,
-			   rep_STR(string), length);
+			   (gpointer) rep_STR(string), length);
 
 	    fp->drawn.text = string;
 	}
@@ -1378,7 +1378,7 @@
 {
     Lisp_Window *w = fp->win;
     XSetWindowAttributes wa;
-    u_long wamask;
+    unsigned long wamask;
     if (fp->id == 0)
     {
 	if (fp->width > 0 && fp->height > 0)
@@ -1458,7 +1458,7 @@
     bool bigger;
     int nparts = 0;
     XSetWindowAttributes wa;
-    u_long wamask;
+    unsigned long wamask;
     int old_x_off, old_y_off;
 
     /* bounding box of frame */

Modified: trunk/src/functions.c
==============================================================================
--- trunk/src/functions.c	(original)
+++ trunk/src/functions.c	Mon Aug  4 14:42:49 2008
@@ -641,8 +641,8 @@
     Atom a_prop;
     Atom type;
     int format;
-    u_long nitems;
-    u_char *data = 0;
+    unsigned long nitems;
+    unsigned char *data = 0;
     repv type_sym, ret_data = Qnil;
 
     w = x_win_from_arg (win);
@@ -662,7 +662,7 @@
     /* First read the data.. */
     {
 	long long_length = 32;
-	u_long bytes_after;
+	unsigned long bytes_after;
 	while (1)
 	{
 	    ret_data = Qnil;
@@ -676,7 +676,7 @@
 		goto out;
 	    if (bytes_after == 0)
 		break;
-	    long_length += (bytes_after / sizeof(u_long)) + 1;
+	    long_length += (bytes_after / sizeof(unsigned long)) + 1;
 	}
     }
 
@@ -686,24 +686,24 @@
     /* Then convert the contents to a vector or string */
     switch (format)
     {
-	u_short *s_data;
-	u_long *l_data;
+	unsigned short *s_data;
+	unsigned long *l_data;
 	int i;
 
     case 8:
-	ret_data = rep_string_dupn (data, nitems);
+	ret_data = rep_string_dupn ((gpointer) data, nitems);
 	break;
 
     case 16:
 	ret_data = Fmake_vector (rep_MAKE_INT(nitems), Qnil);
-	s_data = (u_short *)data;
+	s_data = (unsigned short *)data;
 	for (i = 0; i < nitems; i++)
 	    rep_VECTI(ret_data, i) = rep_MAKE_INT(s_data[i]);
 	break;
 
     case 32:
 	ret_data = Fmake_vector (rep_MAKE_INT(nitems), Qnil);
-	l_data = (u_long *)data;
+	l_data = (unsigned long *)data;
 	for (i = 0; i < nitems; i++)
 	{
 	    repv name;
@@ -747,8 +747,8 @@
 {
     Window w;
     Atom a_prop, a_type;
-    u_long nitems;
-    u_char *c_data = 0;
+    unsigned long nitems;
+    unsigned char *c_data = 0;
 
     w = x_win_from_arg (win);
     rep_DECLARE2(prop, rep_SYMBOLP);
@@ -773,12 +773,12 @@
     switch (rep_INT(format))
     {
 	int i;
-	u_short *s_data;
-	u_long *l_data;
+	unsigned short *s_data;
+	unsigned long *l_data;
 
     case 8:
 	if (rep_STRINGP(data))
-	    c_data = rep_STR (data);
+	    c_data = (gpointer) rep_STR (data);
 	else
 	{
 	    c_data = alloca (nitems);
@@ -790,8 +790,8 @@
     case 16:
 	if (rep_STRINGP(data))
 	    return rep_signal_arg_error (data, 3);
-	c_data = alloca (nitems * sizeof (u_short));
-	s_data = (u_short *)c_data;
+	c_data = alloca (nitems * sizeof (unsigned short));
+	s_data = (unsigned short *)c_data;
 	for (i = 0; i < nitems; i++)
 	    s_data[i] = rep_INT(rep_VECTI(data, i));
 	break;
@@ -799,8 +799,8 @@
     case 32:
 	if (rep_STRINGP(data))
 	    return rep_signal_arg_error (data, 3);
-	c_data = alloca (nitems * sizeof (u_long));
-	l_data = (u_long *)c_data;
+	c_data = alloca (nitems * sizeof (unsigned long));
+	l_data = (unsigned long *)c_data;
 	for (i = 0; i < nitems; i++)
 	{
 	    if (a_type == XA_ATOM && rep_SYMBOLP(rep_VECTI(data, i)))
@@ -1064,7 +1064,7 @@
     if (message_win != 0)
     {
 	XGCValues values;
-	u_long mask;
+	unsigned long mask;
 	char *ptr;
 	int row = 0;
 
@@ -1090,7 +1090,7 @@
 		offset = MSG_PAD_X;
 	    else
 	    {
-		int width = x_text_width (message.font, ptr, end - ptr);
+		int width = x_text_width (message.font, (gpointer) ptr, end - ptr);
 		if (message.justify == Qright)
 		    offset = message.width - (width + MSG_PAD_X);
 		else
@@ -1102,7 +1102,7 @@
 			   + row * (VFONT(message.font)->ascent
 				    + VFONT(message.font)->descent
 				    + message.spacing)
-			   + VFONT(message.font)->ascent, ptr, end - ptr);
+			   + VFONT(message.font)->ascent, (gpointer) ptr, end - ptr);
 	    row++;
 	    ptr = end;
 	    if (*ptr == '\n')
@@ -1223,7 +1223,7 @@
 		char *end = strchr (ptr, '\n');
 		if (end == 0)
 		  end = ptr + strlen (ptr);
-		text_width = x_text_width (message.font, ptr, end - ptr);
+		text_width = x_text_width (message.font, (gpointer) ptr, end - ptr);
 		max_width = MAX(max_width, text_width);
 		rows++;
 		ptr = end;

Modified: trunk/src/gradient.c
==============================================================================
--- trunk/src/gradient.c	(original)
+++ trunk/src/gradient.c	Mon Aug  4 14:42:49 2008
@@ -24,10 +24,10 @@
 DEFUN("draw-vertical-gradient", Fdraw_vertical_gradient,
       Sdraw_vertical_gradient, (repv img, repv from_, repv to_), rep_Subr3)
 {
-    u_char from[3], to[3];
+    unsigned char from[3], to[3];
     int width, height, stride, channels;
     int x, y;
-    u_char *data;
+    unsigned char *data;
 
     rep_DECLARE1(img, IMAGEP);
     rep_DECLARE2(from_, COLORP);
@@ -66,10 +66,10 @@
 DEFUN("draw-horizontal-gradient", Fdraw_horizontal_gradient,
       Sdraw_horizontal_gradient, (repv img, repv from_, repv to_), rep_Subr3)
 {
-    u_char from[3], to[3];
+    unsigned char from[3], to[3];
     int width, height, stride, channels;
     int x, y;
-    u_char *data;
+    unsigned char *data;
 
     rep_DECLARE1(img, IMAGEP);
     rep_DECLARE2(from_, COLORP);
@@ -111,7 +111,7 @@
     double from[3], to[3];
     int width, height, stride, channels;
     int x, y;
-    u_char *data;
+    unsigned char *data;
 
     rep_DECLARE1(img, IMAGEP);
     rep_DECLARE2(from_, COLORP);

Modified: trunk/src/images.c
==============================================================================
--- trunk/src/images.c	(original)
+++ trunk/src/images.c	Mon Aug  4 14:42:49 2008
@@ -179,7 +179,7 @@
     {
 	Pixmap bitmap;
 	int ret = XReadBitmapFile (dpy, root_window, rep_STR(file),
-				   widthp, heightp, &bitmap, x_hotp, y_hotp);
+				   (gpointer) widthp, (gpointer) heightp, &bitmap, x_hotp, y_hotp);
 
 	if (delete)
 	    Fdelete_file (file);
@@ -235,7 +235,7 @@
    if (rep_INTP (mask_id))
        mask = rep_INT (mask_id);
 
-   if (!XGetGeometry (dpy, d, &root, &x, &y, &w, &h, &bdr, &dp))
+   if (!XGetGeometry (dpy, d, &root, &x, &y, (gpointer) &w, (gpointer) &h, (gpointer) &bdr, (gpointer) &dp))
        return Qnil;
 
 #if defined HAVE_IMLIB
@@ -247,7 +247,7 @@
        XImage *xim = XGetImage (dpy, mask, 0, 0, w, h, AllPlanes, ZPixmap);
        if (xim != 0)
        {
-	   u_char *pixels = im->rgb_data;
+	   unsigned char *pixels = im->rgb_data;
 	   int x, y;
 	   ImlibColor shape;
 
@@ -259,8 +259,8 @@
 	   {
 	       for (x = 0; x < w; x++)
 	       {
-		   u_long pixel = XGetPixel (xim, x, y);
-		   u_char *rgb = pixels + ((y * w) + x) * 3;
+		   unsigned long pixel = XGetPixel (xim, x, y);
+		   unsigned char *rgb = pixels + ((y * w) + x) * 3;
 		   if (pixel != 0 && rgb[0] == shape.r
 		       && rgb[1] == shape.g && rgb[2] == shape.b)
 		   {
@@ -287,7 +287,7 @@
 	       {
 		   if (XGetPixel (xim, x, y) == 0)
 		   {
-		       u_char *rgb = pixels + ((y * w) + x) * 3;
+		       unsigned char *rgb = pixels + ((y * w) + x) * 3;
 		       rgb[0] = shape.r;
 		       rgb[1] = shape.g;
 		       rgb[2] = shape.b;
@@ -309,14 +309,14 @@
        if (xim != 0)
        {
 	   int rowstride = gdk_pixbuf_get_rowstride (im);
-	   u_char *pixels = gdk_pixbuf_get_pixels (im);
+	   unsigned char *pixels = gdk_pixbuf_get_pixels (im);
 	   int x, y;
 	   for (y = 0; y < h; y++)
 	   {
 	       for (x = 0; x < w; x++)
 	       {
 		   int idx = y * rowstride + x * 3;
-		   u_char chan = (XGetPixel (xim, x, y) != 0) ? 0 : 255;
+		   unsigned char chan = (XGetPixel (xim, x, y) != 0) ? 0 : 255;
 		   pixels[idx+0] = chan;
 		   pixels[idx+1] = chan;
 		   pixels[idx+2] = chan;
@@ -400,17 +400,17 @@
     Imlib_flip_image_horizontal (imlib_id, VIMAGE(image)->image);
 #else
     {
-	u_char *pixels = image_pixels (VIMAGE (image));
+	unsigned char *pixels = image_pixels (VIMAGE (image));
 	int channels = image_channels (VIMAGE (image));
 	int stride = image_row_stride (VIMAGE (image));
 	int width = image_width (VIMAGE (image));
 	int height = image_height (VIMAGE (image));
-	u_char *buf = alloca (channels);
+	unsigned char *buf = alloca (channels);
 	int y;
 	for (y = 0; y < height; y++)
 	{
-	    u_char *left = pixels + y * stride;
-	    u_char *right = left + channels * (width - 1);
+	    unsigned char *left = pixels + y * stride;
+	    unsigned char *right = left + channels * (width - 1);
 	    while (left < right)
 	    {
 		memcpy (buf, left, channels);
@@ -439,11 +439,11 @@
     Imlib_flip_image_vertical (imlib_id, VIMAGE(image)->image);
 #else
     {
-	u_char *pixels = image_pixels (VIMAGE (image));
+	unsigned char *pixels = image_pixels (VIMAGE (image));
 	int stride = image_row_stride (VIMAGE (image));
 	int height = image_height (VIMAGE (image));
-	u_char *buf = alloca (stride);
-	u_char *top = pixels, *bottom = pixels + (height - 1) * stride;
+	unsigned char *buf = alloca (stride);
+	unsigned char *top = pixels, *bottom = pixels + (height - 1) * stride;
 	while (top < bottom)
 	{
 	    memcpy (buf, top, stride);
@@ -478,13 +478,13 @@
 	int in_stride = gdk_pixbuf_get_rowstride (in);
 	int in_width = gdk_pixbuf_get_width (in);
 	int in_height = gdk_pixbuf_get_height (in);
-	u_char *in_pixels = gdk_pixbuf_get_pixels (in);
+	unsigned char *in_pixels = gdk_pixbuf_get_pixels (in);
 	GdkPixbuf *out = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (in),
 					 gdk_pixbuf_get_has_alpha (in),
 					 gdk_pixbuf_get_bits_per_sample (in),
 					 in_height, in_width);
 	int out_stride = gdk_pixbuf_get_rowstride (out);
-	u_char *out_pixels = gdk_pixbuf_get_pixels (out);
+	unsigned char *out_pixels = gdk_pixbuf_get_pixels (out);
 	int x, y;
 	for (y = 0; y < in_height; y++)
 	{
@@ -745,7 +745,7 @@
 }
 
 static inline void
-bevel_pixel (u_char *data, bool up, int bevel_percent)
+bevel_pixel (unsigned char *data, bool up, int bevel_percent)
 {
     unsigned int t0 = data[0], t1 = data[1], t2 = data[2];
     if (up)
@@ -763,13 +763,13 @@
 }
 
 static inline void
-bevel_region (u_char *data, int row_stride, int bpp,
+bevel_region (unsigned char *data, int row_stride, int bpp,
 	      int rx, int ry, int rw, int rh, bool up, int bevel_percent)
 {
     int x, y;
     for (y = ry; y < ry + rh; y++)
     {
-	u_char *row = data + y * row_stride + rx * bpp;
+	unsigned char *row = data + y * row_stride + rx * bpp;
 	for (x = rx; x < rx + rh; x++)
 	{
 	    bevel_pixel (row, up, bevel_percent);
@@ -779,7 +779,7 @@
 }
 
 static inline void
-bevel_horizontally (u_char *data, int width, int height,
+bevel_horizontally (unsigned char *data, int width, int height,
 		    int row_stride, int channels, 
 		    int border, bool top, bool up, int bevel_percent)
 {
@@ -787,7 +787,7 @@
     up = top ? up : !up;
     for (rows = 0; rows < border; rows++)
     {
-	u_char *ptr = data;
+	unsigned char *ptr = data;
 	int x;
 	if (top)
 	    ptr += (rows * row_stride) + (rows + 1) * channels;
@@ -802,7 +802,7 @@
 }
 
 static inline void
-bevel_vertically (u_char *data, int width, int height,
+bevel_vertically (unsigned char *data, int width, int height,
 		  int row_stride, int channels,
 		  int border, bool top, bool up, int bevel_percent)
 {
@@ -810,7 +810,7 @@
     up = top ? up : !up;
     for (cols = 0; cols < border; cols++)
     {
-	u_char *ptr = data;
+	unsigned char *ptr = data;
 	int y;
 	if (top)
 	    ptr += cols * channels + (cols * row_stride);
@@ -888,7 +888,7 @@
 {
     int width, height, stride, channels;
     int x, y, r, g, b;
-    u_char *data;
+    unsigned char *data;
 
     rep_DECLARE1(image, IMAGEP);
     if (COLORP(color))
@@ -936,7 +936,7 @@
 defines the color of its pixels.
 ::end:: */
 {
-    u_char *data;
+    unsigned char *data;
     int r, g, b;
     rep_DECLARE1(width, rep_INTP);
     rep_DECLARE2(height, rep_INTP);
@@ -998,7 +998,7 @@
     image_t src_im, dst_im;
     int src_width, src_height;
     int dst_width, dst_height;
-    int x, src_y, dst_y;
+    int x,dst_y;
 
     rep_DECLARE1(dst, IMAGEP);
     rep_DECLARE2(src, IMAGEP);
@@ -1103,8 +1103,8 @@
     
 #if defined HAVE_IMLIB
     {
-	u_char *img1_rgb = image_pixels (VIMAGE (img1));
-	u_char *img2_rgb = image_pixels (VIMAGE (img2));
+	unsigned char *img1_rgb = image_pixels (VIMAGE (img1));
+	unsigned char *img2_rgb = image_pixels (VIMAGE (img2));
 	int row, col;
 	ImlibColor shape;
 	Imlib_get_image_shape (imlib_id, VIMAGE (img2)->image, &shape);
@@ -1112,12 +1112,12 @@
 	{
 	    for (col = 0; col < copy_w; col++)
 	    {
-		u_char *img2_pixel = img2_rgb + (row * w2 + col) * 3;
+		unsigned char *img2_pixel = img2_rgb + (row * w2 + col) * 3;
 		if (img2_pixel[0] != shape.r
 		    || img2_pixel[1] != shape.g
 		    || img2_pixel[2] != shape.b)
 		{
-		    u_char *img1_pixel;
+		    unsigned char *img1_pixel;
 		    img1_pixel = img1_rgb + (((rep_INT (y) + row) * w1)
 					     + (rep_INT (x) + col)) * 3;
 		    /* constant size, so should be inlined */
@@ -1209,7 +1209,7 @@
 #endif
 }
 
-u_char *
+unsigned char *
 image_pixels (Lisp_Image *im)
 {
 #if defined HAVE_IMLIB
@@ -1487,7 +1487,7 @@
 get_pixel (Lisp_Image *im, int x, int y)
 {
     int nchannels = image_channels (im);
-    u_char *data = (image_pixels (im)
+    unsigned char *data = (image_pixels (im)
 		    + (y * image_row_stride (im)) + (x * nchannels));
     repv alpha;
 #ifdef HAVE_IMLIB
@@ -1510,7 +1510,7 @@
     {
 	int nchannels = image_channels (im);
 	int alpha = (length > 3) ? rep_INT (rep_CADDDR (pixel)) : 255;
-	u_char *data;
+	unsigned char *data;
 
 #ifdef HAVE_GDK_PIXBUF
 	if (alpha != 255 && nchannels < 4)

Modified: trunk/src/keys.c
==============================================================================
--- trunk/src/keys.c	(original)
+++ trunk/src/keys.c	Mon Aug  4 14:42:49 2008
@@ -32,7 +32,7 @@
 
 /* current_event holds the event we're processing (or 0s), last_event
    contains the previously processed event.  */
-static u_long current_event[2], last_event[2];
+static unsigned long current_event[2], last_event[2];
 
 /* print_prefix means echo all events upto the end of the key-sequence.
    printed_this_prefix says the last event has been echoed. */
@@ -40,12 +40,12 @@
 
 /* Buffer holding the events making this key-sequence. */
 #define EVENT_BUFSIZ 20
-static u_long event_buf[EVENT_BUFSIZ]; /* one event = (code,mods) */
+static unsigned long event_buf[EVENT_BUFSIZ]; /* one event = (code,mods) */
 static int event_index;
 
 /* Data for testing double-clicks */
 static Time last_click;
-static u_long last_click_button;
+static unsigned long last_click_button;
 static int click_count;
 
 /* These control which types of keyboard events we actually evaluate */
@@ -80,14 +80,14 @@
 DEFSYM(multi_click_delay, "multi-click-delay");
 
 /* The X modifiers being used for Meta, Alt, and Hyper */
-static u_long meta_mod, alt_mod, hyper_mod, super_mod;
+static unsigned long meta_mod, alt_mod, hyper_mod, super_mod;
 
 /* The user-customizable modifier; used for default key bindings. This
    shouldn't include any bits that don't have a fixed meaning. */
-static u_long wm_mod = EV_MOD_META;
+static unsigned long wm_mod = EV_MOD_META;
 
 /* The X modifiers bound to the Num_Lock and Scroll_Lock keysyms */
-static u_long num_lock_mod, scroll_lock_mod;
+static unsigned long num_lock_mod, scroll_lock_mod;
 
 DEFSYM(meta_keysyms, "meta-keysyms");
 DEFSYM(alt_keysyms, "alt-keysyms");
@@ -106,8 +106,8 @@
 
 /* Translate from X events to Lisp events */
 
-static u_long
-direct_modifiers (u_long mods)
+static unsigned long
+direct_modifiers (unsigned long mods)
 {
     /* Do this first, since it may contain other indirect mods */
     if (wm_mod != 0 && (mods & EV_MOD_WM))
@@ -125,8 +125,8 @@
     return mods;
 }
 
-static u_long
-indirect_modifiers (u_long mods)
+static unsigned long
+indirect_modifiers (unsigned long mods)
 {
     if(mods & meta_mod)
 	mods = (mods & ~meta_mod) | EV_MOD_META;
@@ -142,7 +142,7 @@
 
 /* Translate the X key or button event XEV to *CODE and *MODS */
 static bool
-translate_event(u_long *code, u_long *mods, XEvent *xev)
+translate_event(unsigned long *code, unsigned long *mods, XEvent *xev)
 {
     repv multi_click_delay;
     int delay;
@@ -296,14 +296,14 @@
 /* Translate the Lisp key event EV to X keycode *KEYCODE and modifier
    mask *STATE, returning true if successful. */
 static bool
-translate_event_to_x_key (repv ev, u_int *keycode, u_int *state)
+translate_event_to_x_key (repv ev, unsigned int *keycode, unsigned int *state)
 {
     if (rep_INT(EVENT_MODS(ev)) & EV_TYPE_KEY)
     {
-	u_int s = rep_INT(EVENT_MODS(ev)) & EV_MOD_MASK;
+	unsigned int s = rep_INT(EVENT_MODS(ev)) & EV_MOD_MASK;
 	KeySym sym = rep_INT(EVENT_CODE(ev));
 	KeySym normal, shifted;
-	u_int k = XKeysymToKeycode (dpy, sym);
+	unsigned int k = XKeysymToKeycode (dpy, sym);
 
 	if (k == 0)
 	    return FALSE;
@@ -334,13 +334,13 @@
 
 /* Translate the Lisp button event EV to X button identifier *BUTTON and
    modifier mask *STATE, returning true if successful. */
-static u_int
-translate_event_to_x_button (repv ev, u_int *button, u_int *state)
+static unsigned int
+translate_event_to_x_button (repv ev, unsigned int *button, unsigned int *state)
 {
     if (rep_INT(EVENT_MODS(ev)) & EV_TYPE_MOUSE)
     {
-	u_long mods = rep_INT(EVENT_MODS(ev));
-	static struct { u_int button; u_int mask; } buttons[] = {
+	unsigned long mods = rep_INT(EVENT_MODS(ev));
+	static struct { unsigned int button; unsigned int mask; } buttons[] = {
 	    { Button1, Button1Mask },
 	    { Button2, Button2Mask },
 	    { Button3, Button3Mask },
@@ -358,7 +358,7 @@
 	{
 	    if (mods & buttons[i].mask)
 	    {
-		u_int s;
+		unsigned int s;
 		mods &= ~buttons[i].mask;
 		s = direct_modifiers (mods & EV_MOD_MASK);
 		if (s == EV_MOD_ANY)
@@ -387,7 +387,7 @@
 /* Keymap searching */
 
 static inline bool
-compare_events (u_long code1, u_long mods1, u_long code2, u_long mods2)
+compare_events (unsigned long code1, unsigned long mods1, unsigned long code2, unsigned long mods2)
 {
     return (code1 == code2
 	    && ((mods1 == mods2)
@@ -405,7 +405,7 @@
    If this function returns true, then this binding is acceptable and
    is returned from the function. */
 static repv
-search_keymap(repv km, u_long code, u_long mods, bool (*callback)(repv key))
+search_keymap(repv km, unsigned long code, unsigned long mods, bool (*callback)(repv key))
 {
     /* If it's a symbol, dereference it. */
     while(rep_SYMBOLP(km) && !rep_NILP(km) && !rep_INTERRUPTP)
@@ -449,7 +449,7 @@
 
 /* Search for a binding of CODE&MODS.  */
 static repv
-lookup_binding(u_long code, u_long mods, bool (*callback)(repv key),
+lookup_binding(unsigned long code, unsigned long mods, bool (*callback)(repv key),
 	       repv context_keymap, Lisp_Window *current_window)
 {
     repv k = rep_NULL, nkp = next_keymap_path;
@@ -537,7 +537,7 @@
 }
 
 static repv
-lookup_event_binding (u_long code, u_long mods, repv context_map)
+lookup_event_binding (unsigned long code, unsigned long mods, repv context_map)
 {
     Lisp_Window *w = 0;
     if (current_x_event && (mods & EV_TYPE_MOUSE))
@@ -559,7 +559,7 @@
 repv
 eval_input_event(repv context_map)
 {
-    u_long code, mods;
+    unsigned long code, mods;
     repv result = Qnil, cmd, orig_next_keymap_path = next_keymap_path;
 
     if (!translate_event (&code, &mods, current_x_event))
@@ -647,7 +647,7 @@
 
 struct key_def {
     const char *name;
-    u_long mods, code;
+    unsigned long mods, code;
 };
 
 static struct key_def default_mods[] = {
@@ -742,14 +742,14 @@
 /* Puts the integers defining the event described in DESC into CODE
    and MODS. */
 static bool
-lookup_event(u_long *code, u_long *mods, u_char *desc)
+lookup_event(unsigned long *code, unsigned long *mods, unsigned char *desc)
 {
     char *tem;
     char buf[100];
     *code = *mods = 0;
 
     /* First handle all modifiers */
-    while(*desc && (tem = strchr(desc + 1, '-')) != 0)
+    while(*desc && (tem = strchr((gpointer) desc + 1, '-')) != 0)
     {
 	struct key_def *x = default_mods;
 
@@ -774,10 +774,10 @@
     /* Then go for the code itself */
     {
 	struct key_def *x = default_codes;
-	u_int ks;
+	unsigned int ks;
 	while(x->name != 0)
 	{
-	    if(strcasecmp(desc, x->name) == 0)
+	    if(strcasecmp((gpointer) desc, x->name) == 0)
 	    {
 		*mods |= x->mods;
 		*code = x->code;
@@ -793,7 +793,7 @@
 	    }
 	    x++;
 	}
-	ks = XStringToKeysym(desc);
+	ks = XStringToKeysym((gpointer) desc);
 	if(ks != NoSymbol)
 	{
 	    if (*mods & ShiftMask)
@@ -822,19 +822,19 @@
 
 /* Constructs the name of the event defined by CODE and MODS in BUF.  */
 static bool
-lookup_event_name(u_char *buf, u_long code, u_long mods)
+lookup_event_name(unsigned char *buf, unsigned long code, unsigned long mods)
 {
     int i;
     struct key_def *x;
-    u_long type = mods & EV_TYPE_MASK;
+    unsigned long type = mods & EV_TYPE_MASK;
 
-    char *end = buf, *tem;
+    char *end = (gpointer) buf, *tem;
     *buf = 0;
 
     mods &= EV_MOD_MASK;
     for(i = 32; i >= 0 && mods != 0; i--)	/* magic numbers!? */
     {
-	u_long mask = 1 << i;
+	unsigned long mask = 1 << i;
 	if(mods & mask)
 	{
 	    mods &= ~mask;
@@ -878,8 +878,8 @@
 print_event_prefix(void)
 {
     int i;
-    u_char buf[256];
-    u_char *bufp = buf;
+    unsigned char buf[256];
+    unsigned char *bufp = buf;
 
     if (next_keymap_path == rep_NULL)
 	return FALSE;
@@ -891,7 +891,7 @@
     {
 	if (lookup_event_name (bufp, event_buf[i], event_buf[i+1]))
 	{
-	    bufp += strlen (bufp);
+	    bufp += strlen ((gpointer) bufp);
 	    *bufp++ = ' ';
 	}
     }
@@ -905,7 +905,7 @@
     }
 
     rep_call_lisp1 (global_symbol_value (Qdisplay_message),
-		    rep_string_dupn (buf, bufp - buf));
+		    rep_string_dupn ((gpointer) buf, bufp - buf));
     printed_this_prefix = TRUE;
 
     return TRUE;
@@ -943,13 +943,13 @@
     args = rep_CDR(args);
     while (rep_CONSP(args) && rep_CONSP(rep_CDR(args)))
     {
-	u_long code, mods;
+	unsigned long code, mods;
 	repv key;
 	arg1 = rep_CAR(args);
 	args = rep_CDR(args);
 	if (rep_STRINGP(arg1))
 	{
-	    if (!lookup_event (&code, &mods, rep_STR(arg1)))
+	    if (!lookup_event (&code, &mods, (gpointer) rep_STR(arg1)))
 		return Fsignal (Qbad_event_desc, rep_LIST_1(arg1));
 	}
 	else if(Feventp(arg1) != Qnil)
@@ -991,12 +991,12 @@
     args = rep_CDR(args);
     while (rep_CONSP(args))
     {
-	u_long code, mods;
+	unsigned long code, mods;
 	repv *keyp;
 	arg1 = rep_CAR(args);
 	if (rep_STRINGP(arg1))
 	{
-	    if (!lookup_event (&code, &mods, rep_STR(arg1)))
+	    if (!lookup_event (&code, &mods, (gpointer) rep_STR(arg1)))
 		return Fsignal (Qbad_event_desc, rep_LIST_1(arg1));
 	}
 	else if(Feventp(arg1) != Qnil)
@@ -1066,16 +1066,16 @@
 ::end:: */
 {
     KeySym ks;
-    u_char buf[256];
+    unsigned char buf[256];
     int len;
 
     if(current_x_event == 0)
 	return Fsignal(Qerror, rep_LIST_1(rep_VAL(&not_in_handler)));
 
     len = XLookupString(&current_x_event->xkey,
-			 buf, sizeof (buf) - 1, &ks, NULL);
+			 (gpointer) buf, sizeof (buf) - 1, &ks, NULL);
     if(len > 0)
-	return rep_string_dupn(buf, len);
+	return rep_string_dupn((gpointer) buf, len);
     else
 	return rep_null_string();
 }
@@ -1172,14 +1172,14 @@
 Returns a string naming the event EVENT.
 ::end:: */
 {
-    u_char buf[256];
+    unsigned char buf[256];
     if(!EVENTP(ev))
 	return rep_signal_arg_error(ev, 1);
 
     if(lookup_event_name(buf, rep_INT(EVENT_CODE(ev)),
 			 rep_INT(EVENT_MODS(ev))))
     {
-	return rep_string_dup(buf);
+	return rep_string_dup((gpointer) buf);
     }
     else
 	return Qnil;
@@ -1192,10 +1192,10 @@
 Return the event whose name is EVENT-NAME.
 ::end:: */
 {
-    u_long code, mods;
+    unsigned long code, mods;
     rep_DECLARE1(name, rep_STRINGP);
 
-    if(lookup_event(&code, &mods, rep_STR(name)))
+    if(lookup_event(&code, &mods, (gpointer) rep_STR(name)))
 	return MAKE_EVENT(rep_MAKE_INT(code), rep_MAKE_INT(mods));
     else
 	return Qnil;
@@ -1214,7 +1214,7 @@
 ::end:: */
 {
     repv res, context = Qnil;
-    u_long code, mods;
+    unsigned long code, mods;
 
     if(!EVENTP(ev))
 	return(rep_signal_arg_error(ev, 1));
@@ -1346,7 +1346,7 @@
 	&& !(wa.all_event_masks & (ButtonPressMask | ButtonReleaseMask)))
     {
 	Window d1, *d2, parent;
-	u_int d3;
+	unsigned int d3;
 	    
 	XQueryTree (dpy, w, &d1, &parent, &d2, &d3);
 	if (d2 != 0)
@@ -1398,7 +1398,7 @@
 
     switch (rep_INT(EVENT_MODS(event)) & EV_TYPE_MASK)
     {
-	u_int mask;
+	unsigned int mask;
 
     case EV_TYPE_KEY:
 	if (!translate_event_to_x_key (event, &ev.xkey.keycode,
@@ -1627,7 +1627,7 @@
 }
 
 static void
-set_wm_modifier (u_long mods)
+set_wm_modifier (unsigned long mods)
 {
     wm_mod = indirect_modifiers (mods);
 }
@@ -1663,7 +1663,7 @@
 {
     switch (rep_INT(EVENT_MODS(ev)) & EV_TYPE_MASK)
     {
-	u_int code, state;
+	unsigned int code, state;
 	int i;
 
     case EV_TYPE_KEY:
@@ -1723,7 +1723,7 @@
 {
     switch (rep_INT(EVENT_MODS(ev)) & EV_TYPE_MASK)
     {
-	u_int code, state;
+	unsigned int code, state;
 	int i;
 
     case EV_TYPE_KEY:

Modified: trunk/src/keys.h
==============================================================================
--- trunk/src/keys.h	(original)
+++ trunk/src/keys.h	Mon Aug  4 14:42:49 2008
@@ -40,7 +40,7 @@
     EV_CODE_MOUSE_UP1,
     EV_CODE_MOUSE_CLICK3,
     EV_CODE_MOUSE_UP2,
-    EV_CODE_MOUSE_UP3,
+    EV_CODE_MOUSE_UP3
 };
 
 /* The low 16 bits of the MODS is the standard X modifier mask. Bits
@@ -69,7 +69,7 @@
 
     EV_TYPE_MASK  = 0x000f0000,
     EV_MOD_MASK   = 0x0ff0ffff,
-    EV_VIRT_MOD_MASK = 0x0ff00000,
+    EV_VIRT_MOD_MASK = 0x0ff00000
 };
 
 

Modified: trunk/src/libclient.c
==============================================================================
--- trunk/src/libclient.c	(original)
+++ trunk/src/libclient.c	Mon Aug  4 14:42:49 2008
@@ -67,7 +67,7 @@
 static char *
 system_name(void)
 {
-    u_char buf[256];
+    unsigned char buf[256];
     struct hostent *h;
 
     static char *system_name;
@@ -75,7 +75,7 @@
 	return system_name;
 
 #ifdef HAVE_GETHOSTNAME
-    if(gethostname(buf, 256))
+    if(gethostname((gpointer) buf, 256))
 	return rep_NULL;
 #else
     {
@@ -84,7 +84,7 @@
 	strncpy(buf, uts.nodename, 256);
     }
 #endif
-    h = gethostbyname(buf);
+    h = gethostbyname((gpointer) buf);
     if(h)
     {
 	if(!strchr(h->h_name, '.'))
@@ -97,10 +97,10 @@
 	    system_name = strdup(*aliases ? *aliases : h->h_name);
 	}
 	else
-	    system_name = strdup((u_char *)h->h_name);
+	    system_name = strdup(h->h_name);
     }
     else
-	system_name = strdup(buf);
+	system_name = strdup((gpointer) buf);
     return system_name;
 }
 
@@ -199,12 +199,12 @@
 static char *
 net_server_eval (char *form, int *lenp, int *errorp)
 {
-    u_char *data = 0;
-    u_long nitems;
+    unsigned char *data = 0;
+    unsigned long nitems;
     XEvent ev;
 
     XChangeProperty (dpy, portal, xa_sawfish_request, XA_STRING,
-		     8, PropModeReplace, form, strlen (form));
+		     8, PropModeReplace, (gpointer) form, strlen (form));
     /* swallow the event created by the above */
     XWindowEvent (dpy, portal, PropertyChangeMask, &ev);
 
@@ -226,7 +226,7 @@
 	Atom type;
 	int format;
         long long_length = 16;
-	u_long bytes_after;
+	unsigned long bytes_after;
 
 	while (1)
 	{
@@ -270,8 +270,8 @@
 {
     Atom type;
     int format;
-    u_long bytes_after, nitems;
-    u_char *data;
+    unsigned long bytes_after, nitems;
+    unsigned char *data;
 
     dpy = XOpenDisplay (display);
     if (dpy == 0)
@@ -342,15 +342,15 @@
 {
     /* Protocol is; >req_eval:1, >FORM-LEN:4, >FORM:?, <RES-LEN:4, <RES:?
        in the local byte-order. */
-    u_char req = (lenp != 0) ? req_eval : req_eval_async;
-    u_long len = strlen(form);
+    unsigned char req = (lenp != 0) ? req_eval : req_eval_async;
+    unsigned long len = strlen(form);
     char *result;
 
     if(sock_write(socket_fd, &req, 1) != 1
-       || sock_write(socket_fd, &len, sizeof(u_long)) != sizeof(u_long)
+       || sock_write(socket_fd, &len, sizeof(unsigned long)) != sizeof(unsigned long)
        || sock_write(socket_fd, form, len) != len
        || (req != req_eval_async
-	   && sock_read(socket_fd, &len, sizeof(u_long)) != sizeof(u_long)))
+	   && sock_read(socket_fd, &len, sizeof(unsigned long)) != sizeof(unsigned long)))
     {
 	perror("eval_req");
 	return 0;

Modified: trunk/src/pixmap-cache.c
==============================================================================
--- trunk/src/pixmap-cache.c	(original)
+++ trunk/src/pixmap-cache.c	Mon Aug  4 14:42:49 2008
@@ -39,8 +39,8 @@
 
 #include "sawmill.h"
 
-static u_long cached_pixels, max_cached_pixels = 64 * 1024;
-static u_long hits, misses;
+static unsigned long cached_pixels, max_cached_pixels = 64 * 1024;
+static unsigned long hits, misses;
 
 #ifdef NEED_PIXMAP_CACHE
 

Modified: trunk/src/property-cache.c
==============================================================================
--- trunk/src/property-cache.c	(original)
+++ trunk/src/property-cache.c	Mon Aug  4 14:42:49 2008
@@ -34,16 +34,16 @@
 static repv *cache_props;
 static repv *cache_values;
 static repv cache_vec;
-static u_int cache_ages[CACHE_SIZE];
-static u_int cache_updates[CACHE_SIZE];
-static u_int cache_clock;
+static unsigned int cache_ages[CACHE_SIZE];
+static unsigned int cache_updates[CACHE_SIZE];
+static unsigned int cache_clock;
 
-static u_int cache_hits, cache_misses;
+static unsigned int cache_hits, cache_misses;
 
 repv
 property_cache_ref (repv id, repv prop)
 {
-    u_int h, i;
+    unsigned int h, i;
 
     if (cache_vec == rep_NULL)
 	return rep_NULL;
@@ -71,7 +71,7 @@
 void
 property_cache_set (repv id, repv prop, repv value, int invals)
 {
-    u_int h, i, oldest, oldest_age;
+    unsigned int h, i, oldest, oldest_age;
 
     if (cache_vec == rep_NULL)
     {
@@ -140,7 +140,7 @@
 void
 property_cache_invalidate (repv id, repv prop)
 {
-    u_int h, i;
+    unsigned int h, i;
 
     if (cache_vec == rep_NULL)
 	return;

Modified: trunk/src/sawmill.h
==============================================================================
--- trunk/src/sawmill.h	(original)
+++ trunk/src/sawmill.h	Mon Aug  4 14:42:49 2008
@@ -106,37 +106,37 @@
     struct lisp_window *above, *below;
 
     /* Is the client window mapped? (by its app) */
-    u_int mapped : 1;
+    unsigned int mapped : 1;
 
     /* Is the frame visible? (not hidden by hide-window) */
-    u_int visible : 1;
+    unsigned int visible : 1;
 
     /* Is the client window hidden by us?
        (controlled by window's `hide-client' property -- used for shading) */
-    u_int client_hidden : 1;
+    unsigned int client_hidden : 1;
 
     /* Is the client window unmapped by us?
        (because it's !visible or client_hidden) */
-    u_int client_unmapped : 1;
+    unsigned int client_unmapped : 1;
 
     /* Is the client window reparented to the frame? */
-    u_int reparented : 1;
+    unsigned int reparented : 1;
 
     /* Is the client window shaped? */
-    u_int shaped : 1;
+    unsigned int shaped : 1;
 
     /* Have we called the destroy-notify-hook? */
-    u_int destroyed : 1;
+    unsigned int destroyed : 1;
 
     /* The WM protocols understood by the client */
-    u_int does_wm_take_focus : 1;
-    u_int does_wm_delete_window : 1;
+    unsigned int does_wm_take_focus : 1;
+    unsigned int does_wm_delete_window : 1;
 
     /* Do we need to send a synthetic ConfigureNotify to this window? */
-    u_int pending_configure : 1;
+    unsigned int pending_configure : 1;
 
     /* Do we need to recalculate the shape mask of the frame? */
-    u_int pending_reshape : 1;
+    unsigned int pending_reshape : 1;
 
     /* The position and dimensions of `attr' is always maintained.
        But the position is the position of the frame, while the
@@ -155,7 +155,7 @@
     Window frame;
     struct frame_part *frame_parts;
     int frame_x, frame_y;		/* relative to client-window */
-    u_int frame_width, frame_height;
+    unsigned int frame_width, frame_height;
     void (*destroy_frame)(struct lisp_window *w);
     void (*focus_change)(struct lisp_window *w);
     void (*rebuild_frame)(struct lisp_window *w);
@@ -256,11 +256,11 @@
     Window id;
     GC gc;
 
-    u_int clicked : 1;
-    u_int highlighted : 1;
-    u_int pending_refresh : 1;
-    u_int below_client : 1;
-    u_int scale_foreground : 1;
+    unsigned int clicked : 1;
+    unsigned int highlighted : 1;
+    unsigned int pending_refresh : 1;
+    unsigned int below_client : 1;
+    unsigned int scale_foreground : 1;
 
     repv text;			/* may be nil, a string, or a function */
     repv x_justify, y_justify;

Modified: trunk/src/sawmill_subrs.h
==============================================================================
--- trunk/src/sawmill_subrs.h	(original)
+++ trunk/src/sawmill_subrs.h	Mon Aug  4 14:42:49 2008
@@ -106,9 +106,9 @@
 /* from fonts.c */
 extern int font_type;
 extern repv Qdefault_font;
-extern int x_text_width (repv font, u_char *string, size_t len);
+extern int x_text_width (repv font, unsigned char *string, size_t len);
 extern void x_draw_string (Window id, repv font, GC gc, Lisp_Color *fg_color,
-			   int x, int y, u_char *string, size_t len);
+			   int x, int y, unsigned char *string, size_t len);
 extern repv Fget_font(repv name);
 extern repv Ffont_get(repv font, repv prop);
 extern repv Ffont_put(repv font, repv prop, repv value);
@@ -216,7 +216,7 @@
 				     int x, int y, int w, int h);
 extern int image_width (Lisp_Image *im);
 extern int image_height (Lisp_Image *im);
-extern u_char *image_pixels (Lisp_Image *im);
+extern unsigned char *image_pixels (Lisp_Image *im);
 extern int image_row_stride (Lisp_Image *im);
 extern int image_channels (Lisp_Image *im);
 extern void image_changed (Lisp_Image *im);

Modified: trunk/src/server.c
==============================================================================
--- trunk/src/server.c	(original)
+++ trunk/src/server.c	Mon Aug  4 14:42:49 2008
@@ -83,7 +83,7 @@
 static void
 server_handle_request(int fd)
 {
-    u_char req;
+    unsigned char req;
     if(sock_read(fd, &req, 1) != 1)
 	goto disconnect;
 
@@ -92,7 +92,7 @@
 
     switch(req)
     {
-	u_long len;
+	unsigned long len;
 	repv val;
 
     case req_eval:
@@ -102,7 +102,7 @@
 	   3. eval and print FORM
 	   4. write length of result-string
 	   5. write LENGTH bytes of result string */
-	if(sock_read(fd, &len, sizeof(u_long)) != sizeof(u_long)
+	if(sock_read(fd, &len, sizeof(unsigned long)) != sizeof(unsigned long)
 	   || (val = rep_make_string(len + 1)) == rep_NULL
 	   || sock_read(fd, rep_STR(val), len) != len)
 	    goto io_error;
@@ -113,14 +113,14 @@
 	    if(val && rep_STRINGP(val))
 	    {
 		len = rep_STRING_LEN(val);
-		if(sock_write(fd, &len, sizeof(u_long)) != sizeof(u_long)
+		if(sock_write(fd, &len, sizeof(unsigned long)) != sizeof(unsigned long)
 		   || sock_write(fd, rep_STR(val), len) != len)
 		    goto io_error;
 	    }
 	    else
 	    {
 		len = 0;
-		if(sock_write(fd, &len, sizeof(u_long)) != sizeof(u_long))
+		if(sock_write(fd, &len, sizeof(unsigned long)) != sizeof(unsigned long))
 		    goto io_error;
 	    }
 	}
@@ -148,7 +148,7 @@
     /* Linux manpage states that we can pass NULL for addr parameters,
        but that has been reported to crash on some systems.. */
 
-    confd = accept(socket_fd, (struct sockaddr *) &addr, &addr_len);
+    confd = accept(socket_fd, (struct sockaddr *) &addr, (gpointer) &addr_len);
 
     if(confd >= 0)
     {

Modified: trunk/src/session.c
==============================================================================
--- trunk/src/session.c	(original)
+++ trunk/src/session.c	Mon Aug  4 14:42:49 2008
@@ -72,7 +72,7 @@
     sm_prop.name = rep_STR(prop);
     if (rep_INTP(value))
     {
-	u_char val = rep_INT(value);
+	unsigned char val = rep_INT(value);
 	sm_prop.type = SmCARD8;
 	sm_prop.num_vals = 1;
 	sm_prop.vals = alloca (sizeof (SmPropValue));

Modified: trunk/src/stacking-list.c
==============================================================================
--- trunk/src/stacking-list.c	(original)
+++ trunk/src/stacking-list.c	Mon Aug  4 14:42:49 2008
@@ -181,7 +181,7 @@
     if (!WINDOW_IS_GONE_P (w))
     {
 	XWindowChanges wc;
-	u_int mask = 0;
+	unsigned int mask = 0;
 
 	return_if_fail (window_in_stacking_list_p (w));
 

Modified: trunk/src/windows.c
==============================================================================
--- trunk/src/windows.c	(original)
+++ trunk/src/windows.c	Mon Aug  4 14:42:49 2008
@@ -228,10 +228,10 @@
 get_window_protocols (Lisp_Window *w)
 {
     Atom *prot;
-    u_int n;
+    unsigned int n;
     w->does_wm_take_focus = 0;
     w->does_wm_delete_window = 0;
-    if (XGetWMProtocols (dpy, w->id, &prot, &n) != 0)
+    if (XGetWMProtocols (dpy, w->id, &prot, (gpointer) &n) != 0)
     {
 	int i;
 	for (i = 0; i < n; i++)
@@ -367,7 +367,7 @@
     {
         char **list;
         int count;
-        prop->nitems = strlen(prop->value);
+        prop->nitems = strlen((gpointer) prop->value);
 #ifdef X_HAVE_UTF8_STRING
         if (Xutf8TextPropertyToTextList (dpy, prop, &list, &count) >= Success)
         {
@@ -429,14 +429,13 @@
 Lisp_Window *
 add_window (Window id)
 {
-    char *tem;
     Lisp_Window *w = rep_ALLOC_CELL(sizeof (Lisp_Window));
     if (w != 0)
     {
 	rep_GC_root gc_win;
 	repv win = rep_VAL(w);
 	XWindowChanges xwc;
-	u_int xwcm;
+	unsigned int xwcm;
 	long supplied;
 
 	DB(("add_window (%lx)\n", id));
@@ -486,7 +485,7 @@
 	{
 	    /* Is the window shaped? */
 	    int xws, yws, xbs, ybs;
-	    u_int wws, hws, wbs, hbs;
+	    unsigned int wws, hws, wbs, hbs;
 	    int bounding, clip;
 	    XShapeSelectInput (dpy, w->id, ShapeNotifyMask);
 	    XShapeQueryExtents (dpy, w->id, &bounding, &xws, &yws, &wws, &hws,
@@ -1396,8 +1395,8 @@
 	   int actual_format;
 	   long nitems, bytes_after;
 	   union {
-	       u_long *l;
-	       u_char *c;
+	       unsigned long *l;
+	       unsigned char *c;
 	   } data;
 
 	   static Atom kwm_win_icon = 0;
@@ -1409,7 +1408,7 @@
 	   if (XGetWindowProperty (dpy, VWIN (win)->id, kwm_win_icon,
 				   0, 2, False, kwm_win_icon,
 				   &actual_type, &actual_format,
-				   &nitems, &bytes_after,
+				   (gpointer) &nitems, (gpointer) &bytes_after,
 				   &data.c) == Success
 	       && actual_type == kwm_win_icon
 	       && bytes_after == 0)

Modified: trunk/src/x.c
==============================================================================
--- trunk/src/x.c	(original)
+++ trunk/src/x.c	Mon Aug  4 14:42:49 2008
@@ -424,7 +424,7 @@
     if (gc != rep_NULL)
     {
 	XGCValues gcv;
-	u_long mask;
+	unsigned long mask;
 
 	mask = x_gc_parse_attrs (VX_GC (gc), &gcv, attrs);
 	if (mask != 0)
@@ -1036,10 +1036,10 @@
 
     x = rep_INT (rep_CAR (xy));
     y = rep_INT (rep_CDR (xy));
-    str = rep_STR (string);
+    str = (gpointer) rep_STR (string);
 
     x_draw_string (id, font, VX_GC (gc)->gc,
-		   &VX_GC (gc)->fg_copy, x, y, str, strlen (str));
+		   &VX_GC (gc)->fg_copy, x, y, str, strlen ((gpointer) str));
     return Qt;
 }
 



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