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

[PATCH 08 of 22] eliminated gcc-4 compilation warnings



# HG changeset patch
# User Dan Pascu <dan@ag-projects.com>
# Date 1124755099 25200
# Branch wm_0_92
# Node ID 345324c47d750b7f1847e926c50f8e044eb4a24f
# Parent  6f8b21fc008fe3618a793761b2a9191bb433140f
eliminated gcc-4 compilation warnings
(transplanted from 5ad9add71d9af23fde28e90c809e7ce78adcbe4c)

diff -r 6f8b21fc008f -r 345324c47d75 ChangeLog
--- a/ChangeLog	Mon Aug 22 12:07:57 2005 -0700
+++ b/ChangeLog	Mon Aug 22 16:58:19 2005 -0700
@@ -7,6 +7,7 @@
 - fixed WPrefs.app to find its icons when not installed under GNUstep paths
 - fixed gcc-4 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
 - fixed amd64 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
+- eliminated gcc-4 compilation warnings
 
 
 Changes since version 0.91.0:
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/Examples/server.c
--- a/WINGs/Examples/server.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/Examples/server.c	Mon Aug 22 16:58:19 2005 -0700
@@ -126,8 +126,8 @@
 }
 
 
-static unsigned char*
-findDelimiter(unsigned char *data, unsigned const char *endPtr)
+static char*
+findDelimiter(char *data, const char *endPtr)
 {
     wassertrv(data < endPtr, NULL);
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/connection.c
--- a/WINGs/connection.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/connection.c	Mon Aug 22 16:58:19 2005 -0700
@@ -201,7 +201,7 @@
 
         if (cPtr->state == WCInProgress) {
             Bool failed;
-            int len = sizeof(result);
+            socklen_t len = sizeof(result);
 
             WCErrorCode = 0;
             if (getsockopt(cPtr->sock, SOL_SOCKET, SO_ERROR,
@@ -462,8 +462,8 @@
 {
     WMConnection *cPtr;
     struct sockaddr_in *socketaddr;
+    socklen_t size;
     int sock, on;
-    int size;
 
     WCErrorCode = 0;
 
@@ -678,7 +678,7 @@
 WMAcceptConnection(WMConnection *listener)
 {
     struct sockaddr_in clientname;
-    int size;
+    socklen_t size;
     int newSock;
     WMConnection *newConnection;
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/dragdestination.c
--- a/WINGs/dragdestination.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/dragdestination.c	Mon Aug 22 16:58:19 2005 -0700
@@ -219,7 +219,7 @@
     }
 
     operationArray = WMCreateDragOperationArray(count);
-    description = descriptionList;
+    description = (char*)descriptionList;
 
     for (i=0; count > 0; i++) {
         size = strlen(description);
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/selection.c
--- a/WINGs/selection.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/selection.c	Mon Aug 22 16:58:19 2005 -0700
@@ -279,7 +279,7 @@
     WMData *wdata;
     unsigned char *data;
     Atom rtype;
-    unsigned bits, bpi;
+    int bits, bpi;
     unsigned long len, bytes;
 
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/wcolor.c
--- a/WINGs/wcolor.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/wcolor.c	Mon Aug 22 16:58:19 2005 -0700
@@ -7,12 +7,12 @@
 
 #define LIGHT_STIPPLE_WIDTH 4
 #define LIGHT_STIPPLE_HEIGHT 4
-static unsigned char LIGHT_STIPPLE_BITS[] = {
+static char LIGHT_STIPPLE_BITS[] = {
     0x05, 0x0a, 0x05, 0x0a};
 
 #define DARK_STIPPLE_WIDTH 4
 #define DARK_STIPPLE_HEIGHT 4
-static unsigned char DARK_STIPPLE_BITS[] = {
+static char DARK_STIPPLE_BITS[] = {
     0x0a, 0x04, 0x0a, 0x01};
 
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/wfont.c
--- a/WINGs/wfont.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/wfont.c	Mon Aug 22 16:58:19 2005 -0700
@@ -27,7 +27,7 @@
     /* Just skip old font names that contain %d in them.
      * We don't support that anymore. */
     if (strchr(xlfd, '%')!=NULL)
-        return FcNameParse(DEFAULT_FONT);
+        return FcNameParse((FcChar8*)DEFAULT_FONT);
 
     fname= wstrdup(xlfd);
     if ((ptr = strchr(fname, ','))) {
@@ -38,7 +38,7 @@
 
     if (!pattern) {
         wwarning(_("invalid font: %s. Trying '%s'"), xlfd, DEFAULT_FONT);
-        pattern = FcNameParse(DEFAULT_FONT);
+        pattern = FcNameParse((FcChar8*)DEFAULT_FONT);
     }
 
     return pattern;
@@ -52,7 +52,7 @@
     char *fname;
 
     pattern = xlfdToFcPattern(xlfd);
-    fname = FcNameUnparse(pattern);
+    fname = (char*)FcNameUnparse(pattern);
     FcPatternDestroy(pattern);
 
     return fname;
@@ -102,7 +102,7 @@
     if (font[0]=='-') {
         pattern = xlfdToFcPattern(font);
     } else {
-        pattern = FcNameParse(font);
+        pattern = FcNameParse((FcChar8*)font);
     }
 
     /*FcPatternPrint(pattern);*/
@@ -116,12 +116,12 @@
     }
 
     if (fallback && !hasPropertyWithStringValue(pattern, FC_FAMILY, fallback)) {
-        FcPatternAddString(pattern, FC_FAMILY, fallback);
+        FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)fallback);
     }
 
     /*FcPatternPrint(pattern);*/
 
-    result = FcNameUnparse(pattern);
+    result = (char*)FcNameUnparse(pattern);
     FcPatternDestroy(pattern);
 
     return result;
@@ -366,7 +366,7 @@
      * return the closest match font to what we requested which is the
      * oblique font. Same goes for using bold for weight.
      */
-    pattern = FcNameParse(WMGetFontName(font));
+    pattern = FcNameParse((FcChar8*)WMGetFontName(font));
     switch (style) {
     case WFSNormal:
         FcPatternDel(pattern, FC_WEIGHT);
@@ -374,21 +374,21 @@
         break;
     case WFSBold:
         FcPatternDel(pattern, FC_WEIGHT);
-        FcPatternAddString(pattern, FC_WEIGHT, "bold");
+        FcPatternAddString(pattern, FC_WEIGHT, (FcChar8*)"bold");
         break;
     case WFSItalic:
         FcPatternDel(pattern, FC_SLANT);
-        FcPatternAddString(pattern, FC_SLANT, "italic");
+        FcPatternAddString(pattern, FC_SLANT,  (FcChar8*)"italic");
         break;
     case WFSBoldItalic:
         FcPatternDel(pattern, FC_WEIGHT);
         FcPatternDel(pattern, FC_SLANT);
-        FcPatternAddString(pattern, FC_WEIGHT, "bold");
-        FcPatternAddString(pattern, FC_SLANT, "italic");
+        FcPatternAddString(pattern, FC_WEIGHT, (FcChar8*)"bold");
+        FcPatternAddString(pattern, FC_SLANT,  (FcChar8*)"italic");
         break;
     }
 
-    name = FcNameUnparse(pattern);
+    name = (char*)FcNameUnparse(pattern);
     copy = WMCreateFont(scrPtr, name);
     FcPatternDestroy(pattern);
     wfree(name);
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/wfontpanel.c
--- a/WINGs/wfontpanel.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/wfontpanel.c	Mon Aug 22 16:58:19 2005 -0700
@@ -83,7 +83,7 @@
 
 
 
-static void setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double size);
+static void setFontPanelFontName(FontPanel *panel, char *family, char *style, double size);
 
 static int isXLFD(char *font, int *length_ret);
 
@@ -370,7 +370,7 @@
 
     if (!isXLFD(fontName, &fname_len)) {
         /* maybe its proper fontconfig and we can parse it */
-        pattern = FcNameParse(fontName);
+        pattern = FcNameParse((FcChar8*)fontName);
     } else {
         /* maybe its proper xlfd and we can convert it to an FcPattern */
         pattern = XftXlfdParse(fontName, False, False);
@@ -383,7 +383,7 @@
     if (FcPatternGetString(pattern, FC_FAMILY, 0, &family)==FcResultMatch)
         if (FcPatternGetString(pattern, FC_STYLE, 0, &style)==FcResultMatch)
             if (FcPatternGetDouble(pattern, "pixelsize", 0, &size)==FcResultMatch)
-                setFontPanelFontName(panel, family, style, size);
+                setFontPanelFontName(panel, (char*)family, (char*)style, size);
 
     FcPatternDestroy(pattern);
 }
@@ -603,7 +603,7 @@
 
             if (FcPatternGetString(fs->fonts[i],FC_FAMILY,0,&family)==FcResultMatch)
                 if (FcPatternGetString(fs->fonts[i],FC_STYLE,0,&style)==FcResultMatch)
-                    addFontToXftFamily(families, family, style);
+                    addFontToXftFamily(families, (char*)family, (char*)style);
         }
         FcFontSetDestroy(fs);
     }
@@ -815,7 +815,7 @@
 
 
 static void
-setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double size)
+setFontPanelFontName(FontPanel *panel, char *family, char *style, double size)
 {
     int famrow;
     int stlrow;
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/widgets.c
--- a/WINGs/widgets.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/widgets.c	Mon Aug 22 16:58:19 2005 -0700
@@ -305,7 +305,7 @@
 
 #define STIPPLE_WIDTH 8
 #define STIPPLE_HEIGHT 8
-static unsigned char STIPPLE_BITS[] = {
+static char STIPPLE_BITS[] = {
     0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55
 };
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/wtext.c
--- a/WINGs/wtext.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/wtext.c	Mon Aug 22 16:58:19 2005 -0700
@@ -207,7 +207,7 @@
 
 #define STIPPLE_WIDTH 8
 #define STIPPLE_HEIGHT 8
-static unsigned char STIPPLE_BITS[] = {
+static char STIPPLE_BITS[] = {
     0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa
 };
 
diff -r 6f8b21fc008f -r 345324c47d75 WINGs/wview.c
--- a/WINGs/wview.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WINGs/wview.c	Mon Aug 22 16:58:19 2005 -0700
@@ -715,7 +715,8 @@
 {
     WMScreen *scr = W_VIEW_SCREEN(view);
     Window foo;
-    int x, y, topX, topY, bar;
+    int x, y, topX, topY;
+    unsigned int bar;
     WMView *topView;
 
     topView = view;
diff -r 6f8b21fc008f -r 345324c47d75 WPrefs.app/FontSimple.c
--- a/WPrefs.app/FontSimple.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/WPrefs.app/FontSimple.c	Mon Aug 22 16:58:19 2005 -0700
@@ -231,11 +231,11 @@
 
         for (i= 0; i < fonts->nfont; i++)
         {
-            FcChar8 *name;
+            char *name;
             int weight, slant, width;
             int j, found;
 
-            if (FcPatternGetString(fonts->fonts[i], FC_FAMILY, 0, &name) != FcResultMatch)
+            if (FcPatternGetString(fonts->fonts[i], FC_FAMILY, 0, (FcChar8**)&name) != FcResultMatch)
               continue;
 
             if (FcPatternGetInteger(fonts->fonts[i], FC_WEIGHT, 0, &weight) != FcResultMatch)
@@ -309,7 +309,7 @@
 
 
 static char*
-getSelectedFont(_Panel *panel, char *curfont)
+getSelectedFont(_Panel *panel, FcChar8 *curfont)
 {
     WMListItem *item;
     FcPattern *pat= FcNameParse(curfont);
@@ -319,7 +319,7 @@
     if (item)
     {
         FcPatternDel(pat, FC_FAMILY);
-        FcPatternAddString(pat, FC_FAMILY, item->text);
+        FcPatternAddString(pat, FC_FAMILY, (FcChar8*)item->text);
     }
 
     item= WMGetListSelectedItem(panel->styleL);
@@ -344,9 +344,9 @@
         FcPatternAddDouble(pat, FC_PIXEL_SIZE, atoi(item->text));
     }
 
-    name= FcNameUnparse(pat);
+    name = (char*)FcNameUnparse(pat);
     FcPatternDestroy(pat);
-    
+
     return name;
 }
 
@@ -446,12 +446,13 @@
         {
             int index= WMGetPopUpButtonSelectedItem(panel->optionP);
             WMMenuItem *item= WMGetPopUpButtonMenuItem(panel->optionP, index);
-            char *ofont, *nfont;
+            FcChar8 *ofont;
+            char *nfont;
 
-            ofont= (char*)WMGetMenuItemRepresentedObject(item);
-            
+            ofont= (FcChar8*)WMGetMenuItemRepresentedObject(item);
             nfont= getSelectedFont(panel, ofont);
-            free(ofont);
+            wfree(ofont);
+
             WMSetMenuItemRepresentedObject(item, nfont);
         }
         updateSampleFont(panel);
@@ -465,12 +466,13 @@
     _Panel *panel= (_Panel*)data;
     int index= WMGetPopUpButtonSelectedItem(panel->optionP);
     WMMenuItem *item= WMGetPopUpButtonMenuItem(panel->optionP, index);
-    char *ofont, *nfont;
+    FcChar8 *ofont;
+    char *nfont;
 
-    ofont= (char*)WMGetMenuItemRepresentedObject(item);
-    
+    ofont = (FcChar8*)WMGetMenuItemRepresentedObject(item);
     nfont= getSelectedFont(panel, ofont);
-    free(ofont);
+    wfree(ofont);
+
     WMSetMenuItemRepresentedObject(item, nfont);
 
     updateSampleFont(panel);
@@ -490,10 +492,10 @@
     {
         FcPattern *pat;
 
-        pat= FcNameParse(font);
+        pat= FcNameParse((FcChar8*)font);
         if (pat)
         {
-            FcChar8 *name;
+            char *name;
             int weight, slant, width;
             double size;
             int distance, closest, found;
@@ -501,7 +503,7 @@
 
             FcDefaultSubstitute(pat);
 
-            if (FcPatternGetString(pat, FC_FAMILY, 0, &name) != FcResultMatch)
+            if (FcPatternGetString(pat, FC_FAMILY, 0, (FcChar8**)&name) != FcResultMatch)
                 name= "sans serif";
 
             found= 0;
diff -r 6f8b21fc008f -r 345324c47d75 src/actions.c
--- a/src/actions.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/actions.c	Mon Aug 22 16:58:19 2005 -0700
@@ -365,7 +365,8 @@
 void
 wMaximizeWindow(WWindow *wwin, int directions)
 {
-    int new_width, new_height, new_x, new_y;
+    int new_x, new_y;
+    unsigned int new_width, new_height;
     int changed_h, changed_v, shrink_h, shrink_v;
     WArea usableArea, totalArea;
 
diff -r 6f8b21fc008f -r 345324c47d75 src/event.c
--- a/src/event.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/event.c	Mon Aug 22 16:58:19 2005 -0700
@@ -558,6 +558,10 @@
             wwin->flags.miniaturized = 0;
             wwin->flags.skip_next_animation = 1;
             wIconifyWindow(wwin);
+        }
+        if (wwin->flags.fullscreen) {
+            wwin->flags.fullscreen = 0;
+            wFullscreenWindow(wwin);
         }
         if (wwin->flags.hidden) {
             WApplication *wapp = wApplicationOf(wwin->main_window);
diff -r 6f8b21fc008f -r 345324c47d75 src/icon.c
--- a/src/icon.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/icon.c	Mon Aug 22 16:58:19 2005 -0700
@@ -651,7 +651,7 @@
     if (icon->icon_win!=None) {
         XWindowAttributes attr;
         int resize=0;
-        int width, height, depth;
+        unsigned int width, height, depth;
         int theight;
         Pixmap pixmap;
 
diff -r 6f8b21fc008f -r 345324c47d75 src/misc.c
--- a/src/misc.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/misc.c	Mon Aug 22 16:58:19 2005 -0700
@@ -1128,7 +1128,7 @@
 void
 SendHelperMessage(WScreen *scr, char type, int workspace, char *msg)
 {
-    unsigned char *buffer;
+    char *buffer;
     int len;
     int i;
     char buf[16];
diff -r 6f8b21fc008f -r 345324c47d75 src/moveres.c
--- a/src/moveres.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/moveres.c	Mon Aug 22 16:58:19 2005 -0700
@@ -1471,7 +1471,7 @@
 
                 ww=w;wh=h;
                 wh-=vert_border;
-                wWindowConstrainSize(wwin, &ww, &wh);
+                wWindowConstrainSize(wwin, (unsigned int*)&ww, (unsigned int*)&wh);
                 wh+=vert_border;
 
                 if (wPreferences.ws_cycle){
@@ -2070,7 +2070,7 @@
                 rh += dh;
                 fw = rw;
                 fh = rh - vert_border;
-                wWindowConstrainSize(wwin, &fw, &fh);
+                wWindowConstrainSize(wwin, (unsigned int*)&fw, (unsigned int*)&fh);
                 fh += vert_border;
                 if (res & LEFT)
                     fx = rx2 - fw + 1;
diff -r 6f8b21fc008f -r 345324c47d75 src/properties.c
--- a/src/properties.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/properties.c	Mon Aug 22 16:58:19 2005 -0700
@@ -234,8 +234,8 @@
     if (image->format == RRGBAFormat) {
         memcpy(&tmp[4], image->data, image->width*image->height*4);
     } else {
-        char *ptr = tmp+4;
-        char *src = image->data;
+        char *ptr = (char*)(tmp+4);
+        char *src = (char*)image->data;
 
         for (y = 0; y < image->height; y++) {
             for (x = 0; x < image->width; x++) {
diff -r 6f8b21fc008f -r 345324c47d75 src/startup.c
--- a/src/startup.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/startup.c	Mon Aug 22 16:58:19 2005 -0700
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <string.h>
 #include <errno.h>
 #include <signal.h>
 #include <sys/wait.h>
diff -r 6f8b21fc008f -r 345324c47d75 src/window.c
--- a/src/window.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/window.c	Mon Aug 22 16:58:19 2005 -0700
@@ -2043,10 +2043,10 @@
  *----------------------------------------------------------------------
  */
 void
-wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight)
+wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nheight)
 {
-    int width = *nwidth;
-    int height = *nheight;
+    int width = (int)*nwidth;
+    int height = (int)*nheight;
     int winc = 1;
     int hinc = 1;
     int minW = 1, minH = 1;
@@ -2143,8 +2143,8 @@
 
 
 void
-wWindowCropSize(WWindow *wwin, int maxW, int maxH,
-                int *width, int *height)
+wWindowCropSize(WWindow *wwin, unsigned int maxW, unsigned int maxH,
+                unsigned int *width, unsigned int *height)
 {
     int baseW = 0, baseH = 0;
     int winc = 1, hinc = 1;
diff -r 6f8b21fc008f -r 345324c47d75 src/window.h
--- a/src/window.h	Mon Aug 22 12:07:57 2005 -0700
+++ b/src/window.h	Mon Aug 22 16:58:19 2005 -0700
@@ -388,9 +388,9 @@
 void wWindowUnfocus(WWindow *wwin);
 
 void wWindowUpdateName(WWindow *wwin, char *newTitle);
-void wWindowConstrainSize(WWindow *wwin, int *nwidth, int *nheight);
-void wWindowCropSize(WWindow *wwin, int maxw, int maxh,
-                     int *nwidth, int *nheight);
+void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nheight);
+void wWindowCropSize(WWindow *wwin, unsigned int maxw, unsigned int maxh,
+                     unsigned int *nwidth, unsigned int *nheight);
 void wWindowConfigure(WWindow *wwin, int req_x, int req_y,
                       int req_width, int req_height);
 
diff -r 6f8b21fc008f -r 345324c47d75 test/wtest.c
--- a/test/wtest.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/test/wtest.c	Mon Aug 22 16:58:19 2005 -0700
@@ -15,11 +15,11 @@
 #include <X11/Xproto.h>
 #include <WMaker.h>
 
-static unsigned char bits[] = {
+static char bits[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-static unsigned char mbits[] = {
+static char mbits[] = {
     0xff, 0x03, 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0x1f, 0x00,
     0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x01, 0x00};
 
diff -r 6f8b21fc008f -r 345324c47d75 util/wmsetbg.c
--- a/util/wmsetbg.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/util/wmsetbg.c	Mon Aug 22 16:58:19 2005 -0700
@@ -787,7 +787,7 @@
 freeTexture(BackgroundTexture *texture)
 {
     if (texture->solid) {
-        long pixel[1];
+        unsigned long pixel[1];
 
         pixel[0] = texture->color.pixel;
         /* dont free black/white pixels */
@@ -966,7 +966,7 @@
 
 
 int
-readmsg(int fd, unsigned char *buffer, int size)
+readmsg(int fd, char *buffer, int size)
 {
     int count;
 
@@ -998,7 +998,7 @@
 {
     BackgroundTexture *textures[WORKSPACE_COUNT];
     int maxTextures = 0;
-    unsigned char buffer[2048], buf[8];
+    char buffer[2048], buf[8];
     int size;
     int errcount = 4;
 
diff -r 6f8b21fc008f -r 345324c47d75 wrlib/convert.c
--- a/wrlib/convert.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/wrlib/convert.c	Mon Aug 22 16:58:19 2005 -0700
@@ -68,8 +68,9 @@
 extern void x86_mmx_TrueColor_32_to_16(unsigned char *image,
                                        unsigned short *ximage,
                                        short *err, short *nerr,
-                                       short *rtable, short *gtable,
-                                       short *btable,
+                                       const unsigned short *rtable,
+                                       const unsigned short *gtable,
+                                       const unsigned short *btable,
                                        int dr, int dg, int db,
                                        unsigned int roffs,
                                        unsigned int goffs,
@@ -175,9 +176,9 @@
 static void
 convertTrueColor_generic(RXImage *ximg, RImage *image,
                          signed char *err, signed char *nerr,
-                         const short *rtable,
-                         const short *gtable,
-                         const short *btable,
+                         const unsigned short *rtable,
+                         const unsigned short *gtable,
+                         const unsigned short *btable,
                          const int dr, const int dg, const int db,
                          const unsigned short roffs,
                          const unsigned short goffs,
@@ -408,8 +409,8 @@
         } else
 #endif /* ASM_X86_MMX */
         {
-            char *err;
-            char *nerr;
+            signed char *err;
+            signed char *nerr;
             int ch = (HAS_ALPHA(image) ? 4 : 3);
 
             err = malloc(ch*(image->width+2));
@@ -447,9 +448,9 @@
 static void
 convertPseudoColor_to_8(RXImage *ximg, RImage *image,
                         signed char *err, signed char *nerr,
-                        const short *rtable,
-                        const short *gtable,
-                        const short *btable,
+                        const unsigned short *rtable,
+                        const unsigned short *gtable,
+                        const unsigned short *btable,
                         const int dr, const int dg, const int db,
                         unsigned long *pixels,
                         int cpc)
@@ -459,7 +460,7 @@
     int pixel;
     int rer, ger, ber;
     unsigned char *ptr = image->data;
-    unsigned char *optr = ximg->image->data;
+    unsigned char *optr = (unsigned char*)ximg->image->data;
     int channels = (HAS_ALPHA(image) ? 4 : 3);
     int cpcpc = cpc*cpc;
 
@@ -573,8 +574,8 @@
         }
     } else {
         /* dither */
-        char *err;
-        char *nerr;
+        signed char *err;
+        signed char *nerr;
         const int dr=0xff/rmask;
         const int dg=0xff/gmask;
         const int db=0xff/bmask;
diff -r 6f8b21fc008f -r 345324c47d75 wrlib/gradient.c
--- a/wrlib/gradient.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/wrlib/gradient.c	Mon Aug 22 16:58:19 2005 -0700
@@ -242,7 +242,7 @@
     RImage *image, *tmp;
     int j;
     float a, offset;
-    char *ptr;
+    unsigned char *ptr;
 
     if (width == 1)
         return renderVGradient(width, height, r0, g0, b0, rf, gf, bf);
diff -r 6f8b21fc008f -r 345324c47d75 wrlib/ppm.c
--- a/wrlib/ppm.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/wrlib/ppm.c	Mon Aug 22 16:58:19 2005 -0700
@@ -43,8 +43,9 @@
 
     } else {
         if (max<256) {
+            unsigned char *ptr;
+            char *buf;
             int x, y;
-            char *buf, *ptr;
 
             buf = malloc(w+1);
             if (!buf) {
@@ -83,7 +84,7 @@
     RImage *image;
     int i;
     char buf[3];
-    char *ptr;
+    unsigned char *ptr;
 
     image = RCreateImage(w, h, 0);
     if (!image) {
diff -r 6f8b21fc008f -r 345324c47d75 wrlib/raster.c
--- a/wrlib/raster.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/wrlib/raster.c	Mon Aug 22 16:58:19 2005 -0700
@@ -283,31 +283,37 @@
 
 int
 calculateCombineArea(RImage *des, RImage *src, int *sx, int *sy,
-                     int *swidth, int *sheight, int *dx, int *dy)
+                     unsigned int *swidth, unsigned int *sheight, int *dx, int *dy)
 {
+    int width = (int)*swidth, height = (int)*sheight;
+
     if (*dx < 0) {
         *sx = -*dx;
-        *swidth = *swidth + *dx;
+        width = width + *dx;
         *dx = 0;
     }
 
-    if (*dx + *swidth > des->width) {
-        *swidth = des->width - *dx;
+    if (*dx + width > des->width) {
+        width = des->width - *dx;
     }
 
     if (*dy < 0) {
         *sy = -*dy;
-        *sheight = *sheight + *dy;
+        height = height + *dy;
         *dy = 0;
     }
 
-    if (*dy + *sheight > des->height) {
-        *sheight = des->height - *dy;
+    if (*dy + height > des->height) {
+        height = des->height - *dy;
     }
 
-    if (*sheight > 0 && *swidth > 0) {
+    if (height>0 && width>0) {
+        *swidth  = width;
+        *sheight = height;
         return True;
-    } else return False;
+    }
+
+    return False;
 }
 
 void
diff -r 6f8b21fc008f -r 345324c47d75 wrlib/x86_specific.c
--- a/wrlib/x86_specific.c	Mon Aug 22 12:07:57 2005 -0700
+++ b/wrlib/x86_specific.c	Mon Aug 22 16:58:19 2005 -0700
@@ -85,9 +85,9 @@
                            unsigned short *ximage,
                            short *err,
                            short *nerr,
-                           short *rtable,
-                           short *gtable,
-                           short *btable,
+                           unsigned short *rtable,
+                           unsigned short *gtable,
+                           unsigned short *btable,
                            int dr,
                            int dg,
                            int db,
@@ -99,13 +99,17 @@
                            int line_offset)
 {
     union {
-	long long rrggbbaa;
-	struct {short int rr, gg, bb, aa;} words;
+        long long rrggbbaa;
+        struct {
+            short int rr, gg, bb, aa;
+        } words;
     } rrggbbaa;
-    
+
     union {
-	long long pixel;
-	struct {short int rr, gg, bb, aa;} words;
+        long long pixel;
+        struct {
+            short int rr, gg, bb, aa;
+        } words;
     } pixel;
 
     short *tmp_err;
@@ -114,7 +118,7 @@
 
     asm volatile
         (
-         "pushl %%ebx                        \n\t"
+         "pushl %%ebx                   \n\t"
 
          // pack dr, dg and db into mm6
          "movl  %7, %%eax               \n\t"
@@ -227,7 +231,7 @@
          "movq %%mm0, %%mm1             \n\t"
          "pmullw %%mm5, %%mm1           \n\t" // mm1 = mm1*7
          "psrlw %%mm7, %%mm1            \n\t" // mm1 = mm1/16
-         "paddw 8(%%ebx), %%mm1                \n\t"
+         "paddw 8(%%ebx), %%mm1         \n\t"
          "movq %%mm1, 8(%%ebx)          \n\t" // err[x+1,y] = rer*7/16
 
 
@@ -236,7 +240,7 @@
          "movq %%mm0, %%mm1             \n\t"
          "pmullw %%mm4, %%mm1           \n\t" // mm1 = mm1*5
          "psrlw %%mm7, %%mm1            \n\t" // mm1 = mm1/16
-         "paddw -8(%%ebx), %%mm1                \n\t"
+         "paddw -8(%%ebx), %%mm1        \n\t"
          "movq %%mm1, -8(%%ebx)         \n\t" // err[x-1,y+1] += rer*3/16
 
          "movq %%mm0, %%mm1             \n\t"
@@ -282,7 +286,7 @@
          // because, punpcklbw is used (which reads 8 bytes) and the last
          // pixel is only 4 bytes. This is no problem because the image data
          // was allocated with extra 4 bytes when created.
-         "addl $4, %%esi                        \n\t" // image->data += 4
+         "addl $4, %%esi                \n\t" // image->data += 4
 
 
          "decl %26                      \n\t" // x--
@@ -298,7 +302,7 @@
 
 ".Enda:                                 \n\t" // THE END
          "emms                          \n\t"
-         "popl %%ebx                         \n\t"
+         "popl %%ebx                    \n\t"
          :
          :
          "m" (image),                      // %0
@@ -317,18 +321,18 @@
          "m" (width),                      // %13
          "m" (height),                     // %14
          "m" (line_offset),                // %15
-         "m" (rrggbbaa.rrggbbaa),          // %16 (access to rr)
+         "m" (rrggbbaa.words.rr),          // %16 (access to rr)
          "m" (rrggbbaa.words.gg),          // %17 (access to gg)
          "m" (rrggbbaa.words.bb),          // %18 (access to bb)
          "m" (rrggbbaa.words.aa),          // %19 (access to aa)
-         "m" (pixel.pixel),                // %20 (access to pixel.r)
+         "m" (pixel.words.rr),             // %20 (access to pixel.r)
          "m" (pixel.words.gg),             // %21 (access to pixel.g)
          "m" (pixel.words.bb),             // %22 (access to pixel.b)
          "m" (pixel.words.aa),             // %23 (access to pixel.a)
          "m" (tmp_err),                    // %24
          "m" (tmp_nerr),                   // %25
          "m" (x)                           // %26
-	 : "eax", "ecx", "edx", "esi", "edi"
+         : "eax", "ecx", "edx", "esi", "edi"
         );
 }
 
@@ -352,13 +356,17 @@
                            int line_offset)
 {
     union {
-	long long rrggbbaa;
-	struct {short int rr, gg, bb, aa;} words;
+        long long rrggbbaa;
+        struct {
+            short int rr, gg, bb, aa;
+        } words;
     } rrggbbaa;
     
     union {
-	long long pixel;
-	struct {short int rr, gg, bb, aa;} words;
+        long long pixel;
+        struct {
+            short int rr, gg, bb, aa;
+        } words;
     } pixel;
 
     short *tmp_err;
@@ -370,7 +378,7 @@
 
     asm volatile
         (
-         "pushl %%ebx                        \n\t"
+         "pushl %%ebx                   \n\t"
 
          "movl %13, %%eax               \n\t" // eax = width
          "movl %%eax, %%ebx             \n\t"
@@ -440,7 +448,7 @@
 
 ".Endc:                                 \n\t" // THE END
          "emms                          \n\t"
-         "popl %%ebx                         \n\t"
+         "popl %%ebx                    \n\t"
          :
          :
          "m" (image),                      // %0
@@ -459,11 +467,11 @@
          "m" (width),                      // %13
          "m" (height),                     // %14
          "m" (line_offset),                // %15
-         "m" (rrggbbaa.rrggbbaa),          // %16 (access to rr)
+         "m" (rrggbbaa.words.rr),          // %16 (access to rr)
          "m" (rrggbbaa.words.gg),          // %17 (access to gg)
          "m" (rrggbbaa.words.bb),          // %18 (access to bb)
          "m" (rrggbbaa.words.aa),          // %19 (access to aa)
-         "m" (pixel.pixel),                // %20 (access to pixel.r)
+         "m" (pixel.words.rr),             // %20 (access to pixel.r)
          "m" (pixel.words.gg),             // %21 (access to pixel.g)
          "m" (pixel.words.bb),             // %22 (access to pixel.b)
          "m" (pixel.words.aa),             // %23 (access to pixel.a)
@@ -472,7 +480,7 @@
          "m" (x),                          // %26
          "m" (w1),                         // %27
          "m" (w2)                          // %28
-	  : "eax", "ecx", "edx", "esi", "edi"
+         : "eax", "ecx", "edx", "esi", "edi"
         );
 }
 
@@ -670,7 +678,7 @@
          "movw $0xff, %%dx              \n\t" // pixel.blu > 255
          "jmp .OKBb                     \n"
 ".NEGBb:                                \n\t"
-         "xorw %%dx, %%dx                       \n"
+         "xorw %%dx, %%dx               \n"
 ".OKBb:                                 \n\t"
          //partial reg
          "leal (%%edi, %%edx, 2), %%ecx \n\t" // ecx = &ctable[pixel.blu]


-- 
To unsubscribe, send mail to wmaker-dev-unsubscribe@lists.windowmaker.info.