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

gEDA-cvs: pcb.git: branch: master updated (414da4d9d6b83756ba7cc1e727211d05338e987a)



The branch, master has been updated
       via  414da4d9d6b83756ba7cc1e727211d05338e987a (commit)
      from  71898679b6f0b0ba7a416d1d43d6c729d0f5339b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/lesstif/dialogs.c |   10 +++++-----
 src/hid/lesstif/lesstif.h |    4 ++--
 src/hid/lesstif/main.c    |   31 ++++++++++++++++---------------
 src/hid/lesstif/menu.c    |    3 +--
 src/hid/lesstif/styles.c  |    2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)


=================
 Commit Messages
=================

commit 414da4d9d6b83756ba7cc1e727211d05338e987a
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    C++ compatibility for the lesstif HID.
    
    Minor changes - casts, consts, keyword renames, so that the lesstif HID
    can be compiled as C or C++.

:100644 100644 a56e3a3... 8756d1f... M	src/hid/lesstif/dialogs.c
:100644 100644 3bc822b... 66a5c12... M	src/hid/lesstif/lesstif.h
:100644 100644 70a00dc... 11740c7... M	src/hid/lesstif/main.c
:100644 100644 6442fcd... 297768b... M	src/hid/lesstif/menu.c
:100644 100644 9b67d0f... 829caab... M	src/hid/lesstif/styles.c

=========
 Changes
=========

commit 414da4d9d6b83756ba7cc1e727211d05338e987a
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    C++ compatibility for the lesstif HID.
    
    Minor changes - casts, consts, keyword renames, so that the lesstif HID
    can be compiled as C or C++.

diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index a56e3a3..8756d1f 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -903,7 +903,7 @@ Open the netlist window.
 static int
 DoWindows (int argc, char **argv, int x, int y)
 {
-  char *a = argc == 1 ? argv[0] : "";
+  const char *a = argc == 1 ? argv[0] : "";
   if (strcmp (a, "1") == 0 || strcasecmp (a, "Layout") == 0)
     {
     }
@@ -1356,10 +1356,10 @@ typedef struct {
 static LgResource lgr;
 
 static XtResource lg_resources[] = {
-  { "font", "Font", XtRFontStruct, sizeof(XFontStruct*), XtOffset(LgResource*, font), XtRString, "fixed" },
-  { "foreground", "Foreground", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, fg), XtRString, "black" },
-  { "selectColor", "Foreground", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, sel), XtRString, "blue" },
-  { "background", "Background", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, bg), XtRString, "white" }
+  { "font", "Font", XtRFontStruct, sizeof(XFontStruct*), XtOffset(LgResource*, font), XtRString, (void *)"fixed" },
+  { "foreground", "Foreground", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, fg), XtRString, (void *)"black" },
+  { "selectColor", "Foreground", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, sel), XtRString, (void *)"blue" },
+  { "background", "Background", XtRPixel, sizeof(Pixel), XtOffset(LgResource*, bg), XtRString, (void *)"white" }
 };
 
 #if 0
diff --git a/src/hid/lesstif/lesstif.h b/src/hid/lesstif/lesstif.h
index 3bc822b..66a5c12 100644
--- a/src/hid/lesstif/lesstif.h
+++ b/src/hid/lesstif/lesstif.h
@@ -19,8 +19,8 @@ extern Display *display;
 extern Screen *screen_s;
 extern int screen;
 
-Widget mainwind, work_area, command, hscroll, vscroll;
-Widget m_click;
+extern Widget mainwind, work_area, command, hscroll, vscroll;
+extern Widget m_click;
 
 extern Widget lesstif_menu (Widget, char *, Arg *, int);
 extern int lesstif_key_event (XKeyEvent *);
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 70a00dc..11740c7 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -54,7 +54,7 @@ typedef struct hid_gc_struct
   const char *colorname;
   int width;
   EndCapStyle cap;
-  char xor;
+  char xor_set;
   char erase;
 } hid_gc_struct;
 
@@ -121,6 +121,7 @@ static PinoutData *pinout = 0;
 static int crosshair_x = 0, crosshair_y = 0;
 static int in_move_event = 0, crosshair_in_window = 1;
 
+Widget mainwind;
 Widget work_area, messages, command, hscroll, vscroll;
 static Widget m_mark, m_crosshair, m_grid, m_zoom, m_mode, m_status;
 static Widget m_rats;
@@ -1005,14 +1006,14 @@ LoadBackgroundFile (FILE *f, char *filename)
 	 vinfo->depth, vinfo->class);
 #endif
 
-  if (vinfo->class == TrueColor
+  if (vinfo->c_class == TrueColor
       && vinfo->depth == 16
       && vinfo->red_mask == 0xf800
       && vinfo->green_mask == 0x07e0
       && vinfo->blue_mask == 0x001f)
     pixel_type = PT_RGB565;
 
-  if (vinfo->class == TrueColor
+  if (vinfo->c_class == TrueColor
       && vinfo->depth == 24
       && vinfo->red_mask == 0xff0000
       && vinfo->green_mask == 0x00ff00
@@ -2010,7 +2011,7 @@ lesstif_parse_arguments (int *argc, char ***argv)
   amax = acount;
 #endif
 
-  new_options = malloc ((amax + 1) * sizeof (XrmOptionDescRec));
+  new_options = (XrmOptionDescRec *) malloc ((amax + 1) * sizeof (XrmOptionDescRec));
 
 #if 0
   memcpy (new_options + acount, lesstif_options, sizeof (lesstif_options));
@@ -2023,8 +2024,8 @@ lesstif_parse_arguments (int *argc, char ***argv)
   rmax = rcount;
 #endif
 
-  new_resources = malloc ((rmax + 1) * sizeof (XtResource));
-  new_values = malloc ((rmax + 1) * sizeof (val_union));
+  new_resources = (XtResource *) malloc ((rmax + 1) * sizeof (XtResource));
+  new_values = (val_union *) malloc ((rmax + 1) * sizeof (val_union));
 #if 0
   memcpy (new_resources + acount, lesstif_resources,
 	  sizeof (lesstif_resources));
@@ -2258,7 +2259,7 @@ draw_grid ()
   if (n > npoints)
     {
       npoints = n + 10;
-      points = realloc (points, npoints * sizeof (XPoint));
+      points = (XPoint *) realloc (points, npoints * sizeof (XPoint));
     }
   n = 0;
   prevx = 0;
@@ -2933,7 +2934,7 @@ lesstif_set_layer (const char *name, int group, int empty)
 static hidGC
 lesstif_make_gc (void)
 {
-  hidGC rv = malloc (sizeof (hid_gc_struct));
+  hidGC rv = (hid_gc_struct *) malloc (sizeof (hid_gc_struct));
   memset (rv, 0, sizeof (hid_gc_struct));
   rv->me_pointer = &lesstif_gui;
   return rv;
@@ -3087,7 +3088,7 @@ set_gc (hidGC gc)
     }
 #if 0
   printf ("set_gc c%s %08lx w%d c%d x%d e%d\n",
-	  gc->colorname, gc->color, gc->width, gc->cap, gc->xor, gc->erase);
+	  gc->colorname, gc->color, gc->width, gc->cap, gc->xor_set, gc->erase);
 #endif
   switch (gc->cap)
     {
@@ -3109,7 +3110,7 @@ set_gc (hidGC gc)
       join = JoinBevel;
       break;
     }
-  if (gc->xor)
+  if (gc->xor_set)
     {
       XSetFunction (display, my_gc, GXxor);
       XSetForeground (display, my_gc, gc->color ^ bgcolor);
@@ -3153,9 +3154,9 @@ lesstif_set_line_width (hidGC gc, int width)
 }
 
 static void
-lesstif_set_draw_xor (hidGC gc, int xor)
+lesstif_set_draw_xor (hidGC gc, int xor_set)
 {
-  gc->xor = xor;
+  gc->xor_set = xor_set;
 }
 
 static void
@@ -3545,7 +3546,7 @@ hidval
 lesstif_watch_file (int fd, unsigned int condition, void (*func) (hidval watch, int fd, unsigned int condition, hidval user_data),
     hidval user_data)
 {
-  WatchStruct *watch = malloc (sizeof(WatchStruct));
+  WatchStruct *watch = (WatchStruct *) malloc (sizeof(WatchStruct));
   hidval ret;
   unsigned int xt_condition = 0;
 
@@ -3595,7 +3596,7 @@ static hidval
 lesstif_add_block_hook (void (*func) (hidval data), hidval user_data )
 {
   hidval ret;
-  BlockHookStruct *block_hook = malloc( sizeof( BlockHookStruct ));
+  BlockHookStruct *block_hook = (BlockHookStruct *) malloc( sizeof( BlockHookStruct ));
 
   block_hook->func = func;
   block_hook->user_data = user_data;
@@ -3727,7 +3728,7 @@ lesstif_show_item (void *item)
   if (!mainwind)
     return;
 
-  pd = calloc (1, sizeof (PinoutData));
+  pd = (PinoutData *) calloc (1, sizeof (PinoutData));
 
   pd->item = item;
 
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 6442fcd..297768b 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -37,7 +37,6 @@ RCSID ("$Id$");
 #define R_OK 4
 #endif
 
-Display *display;
 static Colormap cmap;
 
 static Arg args[30];
@@ -672,7 +671,7 @@ note_widget_flag (Widget w, char *type, char *name)
   if (n_wflags >= max_wflags)
     {
       max_wflags += 20;
-      wflags = realloc (wflags, max_wflags * sizeof (WidgetFlagType));
+      wflags = (WidgetFlagType *) realloc (wflags, max_wflags * sizeof (WidgetFlagType));
     }
   wflags[n_wflags].w = w;
   wflags[n_wflags].flagname = name;
diff --git a/src/hid/lesstif/styles.c b/src/hid/lesstif/styles.c
index 9b67d0f..829caab 100644
--- a/src/hid/lesstif/styles.c
+++ b/src/hid/lesstif/styles.c
@@ -452,7 +452,7 @@ lesstif_insert_style_buttons (Widget menu)
 
   num_style_buttons++;
   s = num_style_buttons * sizeof (StyleButtons);
-  style_button_list = realloc (style_button_list, s);
+  style_button_list = (StyleButtons *) realloc (style_button_list, s);
   sb = style_button_list + num_style_buttons - 1;
 
   for (i = 0; i < NUM_STYLES; i++)




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs