Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 3300) +++ trunk/src_plugins/autoplace/autoplace.c (revision 3301) @@ -470,7 +470,7 @@ GetPointerMemory(TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? &seboxes : &ceboxes); *boxpp = (struct ebox *) malloc(sizeof(**boxpp)); if (*boxpp == NULL) { - fprintf(stderr, "malloc() failed in %s\n", __FUNCTION__); + fprintf(stderr, "malloc() failed in ComputeCost\n"); exit(1); } Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 3300) +++ trunk/src_plugins/export_gcode/gcode.c (revision 3301) @@ -73,7 +73,7 @@ const char *gcode_cookie = "gcode HID"; -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented GCODE function %s.\n", __FUNCTION__); abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented GCODE function %s.\n", func); abort() struct color_struct { /* the descriptor used by the gd library */ int c; @@ -855,7 +855,7 @@ static void gcode_calibrate(double xval, double yval) { - CRASH; + CRASH("gcode_calibrate"); } static void gcode_set_crosshair(int x, int y, int a) Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 3300) +++ trunk/src_plugins/export_gerber/gerber.c (revision 3301) @@ -32,7 +32,7 @@ const char *gerber_cookie = "gerber HID"; -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented Gerber function %s.\n", __FUNCTION__); abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented Gerber function %s.\n", func); abort() /*----------------------------------------------------------------------------*/ /* Function prototypes */ @@ -1148,7 +1148,7 @@ static void gerber_calibrate(double xval, double yval) { - CRASH; + CRASH("gerber_calibrate"); } static int gerber_usage(const char *topic) Index: trunk/src_plugins/export_lpr/lpr.c =================================================================== --- trunk/src_plugins/export_lpr/lpr.c (revision 3300) +++ trunk/src_plugins/export_lpr/lpr.c (revision 3301) @@ -19,8 +19,6 @@ #include "hid_attrib.h" #include "hid_actions.h" -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PS function %s.\n", __FUNCTION__); abort() - const char *lpr_cookie = "lpr HID"; static HID_Attribute base_lpr_options[] = { Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 3300) +++ trunk/src_plugins/export_nelma/nelma.c (revision 3301) @@ -83,7 +83,7 @@ const char *nelma_cookie = "nelma HID"; -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", __FUNCTION__); abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", func); abort() /* Needed for PNG export */ @@ -986,7 +986,7 @@ static void nelma_calibrate(double xval, double yval) { - CRASH; + CRASH("nelma_calibrate"); } static void nelma_set_crosshair(int x, int y, int a) Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 3300) +++ trunk/src_plugins/export_png/png.c (revision 3301) @@ -58,7 +58,7 @@ #include "hid_flags.h" -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", __FUNCTION__); abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented PNG function %s.\n", func); abort() static HID png_hid; @@ -726,7 +726,7 @@ im = gdImageCreate(w, h); if (im == NULL) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", __FUNCTION__, w, h); + Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", w, h); return; } @@ -747,7 +747,7 @@ white->a = 0; white->c = gdImageColorAllocateAlpha(im, white->r, white->g, white->b, white->a); if (white->c == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n"); return; } @@ -757,7 +757,7 @@ black->r = black->g = black->b = black->a = 0; black->c = gdImageColorAllocate(im, black->r, black->g, black->b); if (black->c == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "png_do_export(): gdImageColorAllocateAlpha() returned NULL. Aborting export.\n"); return; } @@ -1015,7 +1015,7 @@ static color_struct *black = NULL, *white = NULL; *photo_im = gdImageCreate(gdImageSX(im), gdImageSY(im)); if (photo_im == NULL) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", __FUNCTION__, gdImageSX(im), gdImageSY(im)); + Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", gdImageSX(im), gdImageSY(im)); return 0; } @@ -1025,7 +1025,7 @@ white->a = 0; white->c = gdImageColorAllocate(*photo_im, white->r, white->g, white->b); if (white->c == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocate() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n"); return 0; } @@ -1033,7 +1033,7 @@ black->r = black->g = black->b = black->a = 0; black->c = gdImageColorAllocate(*photo_im, black->r, black->g, black->b); if (black->c == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocate() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "png_set_layer(): gdImageColorAllocate() returned NULL. Aborting export.\n"); return 0; } @@ -1104,7 +1104,7 @@ if (mask_im == NULL) { mask_im = gdImageCreate(gdImageSX(im), gdImageSY(im)); if (!mask_im) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageCreate(%d, %d) returned NULL. Corrupt export!\n", __FUNCTION__, gdImageSY(im), gdImageSY(im)); + Message(PCB_MSG_DEFAULT, "png_use_mask(): gdImageCreate(%d, %d) returned NULL. Corrupt export!\n", gdImageSY(im), gdImageSY(im)); return; } gdImagePaletteCopy(mask_im, im); @@ -1156,7 +1156,7 @@ sscanf(name + 1, "%2x%2x%2x", &(gc->color->r), &(gc->color->g), &(gc->color->b)); gc->color->c = gdImageColorAllocate(master_im, gc->color->r, gc->color->g, gc->color->b); if (gc->color->c == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocate() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "png_set_color(): gdImageColorAllocate() returned NULL. Aborting export.\n"); return; } cval.ptr = gc->color; @@ -1238,18 +1238,18 @@ int bg, fg; gc->brush = gdImageCreate(r, r); if (gc->brush == NULL) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", __FUNCTION__, r, r); + Message(PCB_MSG_DEFAULT, "use_gc(): gdImageCreate(%d, %d) returned NULL. Aborting export.\n", r, r); return; } bg = gdImageColorAllocate(gc->brush, 255, 255, 255); if (bg == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocate() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n"); return; } fg = gdImageColorAllocateAlpha(gc->brush, gc->color->r, gc->color->g, gc->color->b, 0); if (fg == BADC) { - Message(PCB_MSG_DEFAULT, "%s(): gdImageColorAllocate() returned NULL. Aborting export.\n", __FUNCTION__); + Message(PCB_MSG_DEFAULT, "use_gc(): gdImageColorAllocate() returned NULL. Aborting export.\n"); return; } gdImageColorTransparent(gc->brush, bg); @@ -1473,7 +1473,7 @@ static void png_calibrate(double xval, double yval) { - CRASH; + CRASH("png_calibrate"); } static void png_set_crosshair(int x, int y, int a) Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 3300) +++ trunk/src_plugins/export_ps/eps.c (revision 3301) @@ -23,7 +23,7 @@ #include "hid_flags.h" #include "hid_color.h" -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented EPS function %s.\n", __FUNCTION__); abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented EPS function %s.\n", func); abort() /*----------------------------------------------------------------------------*/ /* Function prototypes */ @@ -584,7 +584,7 @@ static void eps_calibrate(double xval, double yval) { - CRASH; + CRASH("eps_calibrate"); } static void eps_set_crosshair(int x, int y, int action) Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 3300) +++ trunk/src_plugins/export_ps/ps.c (revision 3301) @@ -30,8 +30,6 @@ #include "conf_core.h" #include "compat_misc.h" -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PS function %s.\n", __FUNCTION__); abort() - const char *ps_cookie = "ps HID"; static int ps_set_layer(const char *name, int group, int empty); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c (revision 3300) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/draw.c (revision 3301) @@ -4,16 +4,16 @@ #include "src/hid.h" #include "src/error.h" -#define setup \ +#define setup(func) \ hidGC gc = ctx->gc; \ HID *hid = ctx->hid; \ - if ((hid == NULL) && (gc == NULL)) Message(PCB_MSG_DEFAULT, "%s failed because of invalid hid or gc\n", __FUNCTION__); \ + if ((hid == NULL) && (gc == NULL)) Message(PCB_MSG_DEFAULT, "%s failed because of invalid hid or gc\n", func); \ if ((hid == NULL) && (gc == NULL)) return void draw_set_color(dctx_t *ctx, const char *name) { - setup; + setup("draw_set_color"); hid->set_color(gc, name); } @@ -20,13 +20,13 @@ /*void set_line_cap(dctx_t *ctx, EndCapStyle style_);*/ void draw_set_line_width(dctx_t *ctx, int width) { - setup; + setup("draw_set_line_width"); hid->set_line_width(gc, width); } void draw_set_draw_xor(dctx_t *ctx, int xor) { - setup; + setup("draw_set_draw_xor"); hid->set_draw_xor(gc, xor); } @@ -33,13 +33,13 @@ void draw_set_draw_faded(dctx_t *ctx, int faded) { - setup; + setup("draw_set_draw_faded"); hid->set_draw_faded(gc, faded); } void draw_line(dctx_t *ctx, int x1, int y1, int x2, int y2) { - setup; + setup("draw_line"); hid->draw_line(gc, x1, y1, x2, y2); } Index: trunk/src_plugins/hid_gtk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 3300) +++ trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 3301) @@ -355,7 +355,7 @@ hidval cval; if (name == NULL) { - fprintf(stderr, "%s(): name = NULL, setting to magenta\n", __FUNCTION__); + fprintf(stderr, "ghid_set_color(): name = NULL, setting to magenta\n"); name = "magenta"; } Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3300) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3301) @@ -1159,7 +1159,7 @@ if (name) { if (conf_core.rc.verbose) - fprintf(stderr, "%s: Calling LoadFrom(%s, %s)\n", __FUNCTION__, function, name); + fprintf(stderr, "Load: Calling LoadFrom(%s, %s)\n", function, name); hid_actionl("LoadFrom", function, name, NULL); g_free(name); } @@ -1236,7 +1236,7 @@ if (name) { if (conf_core.rc.verbose) - fprintf(stderr, "%s: Calling SaveTo(%s, %s)\n", __FUNCTION__, function, name); + fprintf(stderr, "Save: Calling SaveTo(%s, %s)\n", function, name); if (strcasecmp(function, "PasteBuffer") == 0) { hid_actionl("PasteBuffer", "Save", name, avail.plug[fmt]->description, "1", NULL); Index: trunk/src_plugins/hid_gtk/gui-dialog-print.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 3300) +++ trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 3301) @@ -280,7 +280,7 @@ gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0); break; default: - printf("%s: unknown type of HID attribute\n", __FUNCTION__); + printf("ghid_attribute_dialog: unknown type of HID attribute\n"); break; } } @@ -329,7 +329,7 @@ if (n > 0) { results = (HID_Attr_Val *) malloc(n * sizeof(HID_Attr_Val)); if (results == NULL) { - fprintf(stderr, "%s() -- malloc failed\n", __FUNCTION__); + fprintf(stderr, "ghid_dialog_print() -- malloc failed\n"); exit(1); } Index: trunk/src_plugins/hid_gtk/gui-dialog.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-dialog.c (revision 3300) +++ trunk/src_plugins/hid_gtk/gui-dialog.c (revision 3301) @@ -441,7 +441,7 @@ recent_dirs = (ghid_file_history *) realloc(recent_dirs, n_recent_dirs * sizeof(ghid_file_history)); if (recent_dirs == NULL) { - fprintf(stderr, "%s(): realloc failed\n", __FUNCTION__); + fprintf(stderr, "ghid_fileselect(): realloc failed\n"); exit(1); } Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 3300) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 3301) @@ -24,8 +24,6 @@ #include "stdarg.h" #include "misc_util.h" -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented GUI function %s\n", __FUNCTION__), abort() - static int ok; #define COMPONENT_SIDE_NAME "(top)" Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 3300) +++ trunk/src_plugins/hid_lesstif/main.c (revision 3301) @@ -76,7 +76,7 @@ static HID lesstif_hid; -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented GUI function %s\n", __FUNCTION__), abort() +#define CRASH(func) fprintf(stderr, "HID error: pcb called unimplemented GUI function %s\n", func), abort() XtAppContext app_context; Widget appwidget; @@ -3249,7 +3249,7 @@ static void lesstif_calibrate(double xval, double yval) { - CRASH; + CRASH("lesstif_calibrate"); } static int lesstif_shift_is_pressed(void) Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 3300) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 3301) @@ -7,8 +7,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -87,13 +87,25 @@ #endif /* ! FLEXINT_H */ -/* TODO: this is always defined, so inline it */ +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST #define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) #else -#define yynoreturn +#define yyconst #endif /* Returned upon end-of-file. */ @@ -149,11 +161,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - extern int yyleng; extern FILE *yyin, *yyout; @@ -176,13 +183,6 @@ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --yylineno;\ - }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -200,6 +200,11 @@ #define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -212,7 +217,7 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -268,7 +273,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -291,7 +296,7 @@ int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -350,7 +355,7 @@ typedef unsigned char YY_CHAR; -FILE *yyin = NULL, *yyout = NULL; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; @@ -359,15 +364,12 @@ int yylineno = 1; extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -374,7 +376,7 @@ */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ + yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -417,7 +419,7 @@ 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -449,7 +451,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[51] = +static yyconst flex_int32_t yy_meta[51] = { 0, 1, 1, 2, 3, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, @@ -458,7 +460,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_uint16_t yy_base[226] = +static yyconst flex_int16_t yy_base[226] = { 0, 0, 0, 256, 257, 253, 257, 257, 46, 0, 0, 42, 45, 46, 13, 16, 230, 213, 23, 207, 208, @@ -516,7 +518,7 @@ 0, 221, 221, 221, 221 } ; -static yyconst flex_uint16_t yy_nxt[308] = +static yyconst flex_int16_t yy_nxt[308] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 4, 12, 13, 14, 4, 15, 16, 17, 18, 19, 20, 21, @@ -711,7 +713,7 @@ */ static int Parse(FILE *Pipe, const const char *Executable, const char *Path, const char *Filename, const char *Parameter); -#line 715 "lex.yy.c" +#line 717 "lex.yy.c" #define INITIAL 0 @@ -744,19 +746,19 @@ FILE *yyget_in (void ); -void yyset_in (FILE * _in_str ); +void yyset_in (FILE * in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * _out_str ); +void yyset_out (FILE * out_str ); - int yyget_leng (void ); +int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); -void yyset_lineno (int _line_number ); +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -770,12 +772,8 @@ #endif #endif -#ifndef YY_NO_UNPUT - static void yyunput (int c,char *buf_ptr ); -#endif - #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -809,7 +807,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -833,7 +831,7 @@ else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -888,7 +886,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif #define YY_RULE_SETUP \ @@ -898,10 +896,15 @@ */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; +#line 109 "../../src_plugins/io_pcb/parse_l.l" + + +#line 907 "lex.yy.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -928,13 +931,7 @@ yy_load_buffer_state( ); } - { -#line 109 "../../src_plugins/io_pcb/parse_l.l" - - -#line 936 "lex.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -950,7 +947,7 @@ yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -962,7 +959,7 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 257 ); @@ -980,7 +977,7 @@ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; + int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) @@ -1317,7 +1314,7 @@ #line 211 "../../src_plugins/io_pcb/parse_l.l" ECHO; YY_BREAK -#line 1321 "lex.yy.c" +#line 1318 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1448,7 +1445,6 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1460,9 +1456,9 @@ */ static int yy_get_next_buffer (void) { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - yy_size_t number_to_move, i; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1491,7 +1487,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1511,7 +1507,7 @@ { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); @@ -1531,7 +1527,7 @@ } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1549,7 +1545,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1573,9 +1569,9 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1594,14 +1590,14 @@ static yy_state_type yy_get_previous_state (void) { - yy_state_type yy_current_state; - char *yy_cp; + register yy_state_type yy_current_state; + register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1613,7 +1609,7 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; @@ -1626,10 +1622,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); - YY_CHAR yy_c = 1; + register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1641,17 +1637,15 @@ if ( yy_current_state >= 222 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 221); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - - static void yyunput (int c, char * yy_bp ) + static void yyunput (int c, register char * yy_bp ) { - char *yy_cp; + register char *yy_cp; yy_cp = (yy_c_buf_p); @@ -1661,10 +1655,10 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = + register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1673,7 +1667,7 @@ yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1690,8 +1684,6 @@ (yy_c_buf_p) = yy_cp; } -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1740,7 +1732,7 @@ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1846,7 +1838,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1881,6 +1873,10 @@ yyfree((void *) b ); } +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -2001,7 +1997,7 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -2018,7 +2014,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; + int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -2048,7 +2044,7 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return NULL; + return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -2057,7 +2053,7 @@ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; + b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2080,7 +2076,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - return yy_scan_bytes(yystr,(int) strlen(yystr) ); + return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -2095,10 +2091,10 @@ YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) _yybytes_len + 2; + n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2124,9 +2120,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn yy_fatal_error (yyconst char* msg ) +static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2192,29 +2188,29 @@ } /** Set the current line number. - * @param _line_number line number + * @param line_number * */ -void yyset_lineno (int _line_number ) +void yyset_lineno (int line_number ) { - yylineno = _line_number; + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param _in_str A readable stream. + * @param in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * _in_str ) +void yyset_in (FILE * in_str ) { - yyin = _in_str ; + yyin = in_str ; } -void yyset_out (FILE * _out_str ) +void yyset_out (FILE * out_str ) { - yyout = _out_str ; + yyout = out_str ; } int yyget_debug (void) @@ -2222,9 +2218,9 @@ return yy_flex_debug; } -void yyset_debug (int _bdebug ) +void yyset_debug (int bdebug ) { - yy_flex_debug = _bdebug ; + yy_flex_debug = bdebug ; } static int yy_init_globals (void) @@ -2236,10 +2232,10 @@ /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; - (yy_buffer_stack) = NULL; + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; + (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; @@ -2248,8 +2244,8 @@ yyin = stdin; yyout = stdout; #else - yyin = NULL; - yyout = NULL; + yyin = (FILE *) 0; + yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by @@ -2287,8 +2283,7 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - - int i; + register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2297,7 +2292,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - int n; + register int n; for ( n = 0; s[n]; ++n ) ; @@ -2307,12 +2302,11 @@ void *yyalloc (yy_size_t size ) { - return malloc(size); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2320,12 +2314,12 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return realloc(ptr, size); + return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 3300) +++ trunk/src_plugins/puller/puller.c (revision 3301) @@ -1266,7 +1266,7 @@ static End *fp_end; static double fa; /* relative angle */ -#define gp_point(x,y,t,e) gp_point_2(x,y,t,e,0,0,__FUNCTION__) +#define gp_point(x,y,t,e) gp_point_2(x,y,t,e,0,0, __FILE__ ":" #__LINE__) static int gp_point_force(int x, int y, int t, End * e, int esa, int eda, int force, const char *name) { @@ -1382,7 +1382,7 @@ pcb_printf(" - new thickness %f old %#mS\n", new_r, t); #endif if (new_r < t) - gp_point_force(x, y, new_r, e, esa, eda, 1, __FUNCTION__); + gp_point_force(x, y, new_r, e, esa, eda, 1, "gp_point_force"); return 0; } @@ -1518,7 +1518,7 @@ return R_DIR_NOT_FOUND; if (e->deleted) return R_DIR_NOT_FOUND; - gp_point_2(a->X, a->Y, a->Width + a->Thickness / 2, 0, a->StartAngle, a->Delta, __FUNCTION__); + gp_point_2(a->X, a->Y, a->Width + a->Thickness / 2, 0, a->StartAngle, a->Delta, "gp_arc_cb"); if (start_arc && a->X == start_arc->X && a->Y == start_arc->Y) return R_DIR_NOT_FOUND; if (end_arc && a->X != end_arc->X && a->Y != end_arc->Y) Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 3300) +++ trunk/src_plugins/renumber/renumber.c (revision 3301) @@ -135,7 +135,7 @@ was = (char **) calloc(numele, sizeof(char *)); is = (char **) calloc(numele, sizeof(char *)); if (element_list == NULL || locked_element_list == NULL || was == NULL || is == NULL) { - fprintf(stderr, "calloc() failed in %s\n", __FUNCTION__); + fprintf(stderr, "calloc() failed in ActionRenumber\n"); exit(1); } @@ -217,7 +217,7 @@ cnt_list_sz += 100; cnt_list = (struct _cnt_list *) realloc(cnt_list, cnt_list_sz); if (cnt_list == NULL) { - fprintf(stderr, "realloc failed() in %s\n", __FUNCTION__); + fprintf(stderr, "realloc() failed in ActionRenumber\n"); exit(1); } /* zero out the memory that we added */