Index: trunk/src/action_act.c =================================================================== --- trunk/src/action_act.c (revision 3142) +++ trunk/src/action_act.c (revision 3143) @@ -46,7 +46,7 @@ %end-doc */ -int ActionExecuteFile(int argc, char **argv, Coord x, Coord y) +int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y) { FILE *fp; const char *fname; Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 3142) +++ trunk/src/buffer.c (revision 3143) @@ -483,7 +483,7 @@ %end-doc */ -int LoadFootprint(int argc, char **argv, Coord x, Coord y) +int LoadFootprint(int argc, const char **argv, Coord x, Coord y) { const char *name = ACTION_ARG(0); const char *refdes = ACTION_ARG(1); @@ -997,7 +997,7 @@ %end-doc */ -int ActionFreeRotateBuffer(int argc, char **argv, Coord x, Coord y) +int ActionFreeRotateBuffer(int argc, const char **argv, Coord x, Coord y) { const char *angle_s; @@ -1302,7 +1302,7 @@ %end-doc */ -static int ActionPasteBuffer(int argc, char **argv, Coord x, Coord y) +static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y) { const char *function = argc ? argv[0] : ""; const char *sbufnum = argc > 1 ? argv[1] : ""; Index: trunk/src/buffer.h =================================================================== --- trunk/src/buffer.h (revision 3142) +++ trunk/src/buffer.h (revision 3143) @@ -51,6 +51,6 @@ void *CopyObjectToBuffer(DataTypePtr, DataTypePtr, int, void *, void *, void *); /* This action is called from ActionElementAddIf() */ -int LoadFootprint(int argc, char **argv, Coord x, Coord y); +int LoadFootprint(int argc, const char **argv, Coord x, Coord y); #endif Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 3142) +++ trunk/src/change_act.c (revision 3143) @@ -51,8 +51,8 @@ #include "layer.h" static void ChangeFlag(const char *, const char *, int, const char *); -static int ActionChangeSize(int argc, char **argv, Coord x, Coord y); -static int ActionChange2ndSize(int argc, char **argv, Coord x, Coord y); +static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y); +static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y); /* --------------------------------------------------------------------------- */ @@ -71,11 +71,11 @@ %end-doc */ -static int ActionChangeClearSize(int argc, char **argv, Coord x, Coord y) +static int ActionChangeClearSize(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *delta = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *delta = ACTION_ARG(1); + const char *units = ACTION_ARG(2); bool absolute; Coord value; int type = PCB_TYPE_NONE; @@ -156,7 +156,7 @@ %end-doc */ -static int ActionChangeFlag(int argc, char **argv, Coord x, Coord y) +static int ActionChangeFlag(int argc, const char **argv, Coord x, Coord y) { const char *function = ACTION_ARG(0); const char *flag = ACTION_ARG(1); @@ -264,9 +264,9 @@ %end-doc */ -static int ActionChangeHole(int argc, char **argv, Coord x, Coord y) +static int ActionChangeHole(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -306,9 +306,9 @@ %end-doc */ -static int ActionChangePaste(int argc, char **argv, Coord x, Coord y) +static int ActionChangePaste(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -350,7 +350,7 @@ with the same arguments. If any of them did not fail, return success. %end-doc */ -static int ActionChangeSizes(int argc, char **argv, Coord x, Coord y) +static int ActionChangeSizes(int argc, const char **argv, Coord x, Coord y) { int a, b, c; SaveUndoSerialNumber(); @@ -384,11 +384,11 @@ %end-doc */ -static int ActionChangeSize(int argc, char **argv, Coord x, Coord y) +static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *delta = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *delta = ACTION_ARG(1); + const char *units = ACTION_ARG(2); bool absolute; /* indicates if absolute size is given */ Coord value; int type = PCB_TYPE_NONE, tostyle = 0; @@ -486,11 +486,11 @@ %end-doc */ -static int ActionChange2ndSize(int argc, char **argv, Coord x, Coord y) +static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *delta = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *delta = ACTION_ARG(1); + const char *units = ACTION_ARG(2); int type = PCB_TYPE_NONE; void *ptr1, *ptr2, *ptr3; @@ -560,10 +560,10 @@ %end-doc */ -static int ActionChangePinName(int argc, char **argv, Coord x, Coord y) +static int ActionChangePinName(int argc, const char **argv, Coord x, Coord y) { int changed = 0; - char *refdes, *pinnum, *pinname; + const char *refdes, *pinnum, *pinname; if (argc != 3) { AFAIL(changepinname); @@ -647,10 +647,10 @@ %end-doc */ -int ActionChangeName(int argc, char **argv, Coord x, Coord y) +int ActionChangeName(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *pinnums = ACTION_ARG(1); + const char *function = ACTION_ARG(0); + const char *pinnums = ACTION_ARG(1); char *name; int pinnum; @@ -728,9 +728,9 @@ %end-doc */ -static int ActionChangeJoin(int argc, char **argv, Coord x, Coord y) +static int ActionChangeJoin(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -781,9 +781,9 @@ %end-doc */ -static int ActionChangeNonetlist(int argc, char **argv, Coord x, Coord y) +static int ActionChangeNonetlist(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -827,9 +827,9 @@ %end-doc */ -static int ActionChangeSquare(int argc, char **argv, Coord x, Coord y) +static int ActionChangeSquare(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -889,9 +889,9 @@ %end-doc */ -static int ActionSetSquare(int argc, char **argv, Coord x, Coord y) +static int ActionSetSquare(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function && *function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -941,9 +941,9 @@ %end-doc */ -static int ActionClearSquare(int argc, char **argv, Coord x, Coord y) +static int ActionClearSquare(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function && *function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -992,9 +992,9 @@ %end-doc */ -static int ActionChangeOctagon(int argc, char **argv, Coord x, Coord y) +static int ActionChangeOctagon(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -1047,9 +1047,9 @@ %end-doc */ -static int ActionSetOctagon(int argc, char **argv, Coord x, Coord y) +static int ActionSetOctagon(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -1103,9 +1103,9 @@ %end-doc */ -static int ActionClearOctagon(int argc, char **argv, Coord x, Coord y) +static int ActionClearOctagon(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_ToggleObject: @@ -1176,10 +1176,10 @@ to connect with. However, they will have no effect without the polygon. %end-doc */ -static int ActionSetThermal(int argc, char **argv, Coord x, Coord y) +static int ActionSetThermal(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *style = ACTION_ARG(1); + const char *function = ACTION_ARG(0); + const char *style = ACTION_ARG(1); void *ptr1, *ptr2, *ptr3; int type, kind; int err = 0; @@ -1242,10 +1242,10 @@ %end-doc */ -static int ActionSetFlag(int argc, char **argv, Coord x, Coord y) +static int ActionSetFlag(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *flag = ACTION_ARG(1); + const char *function = ACTION_ARG(0); + const char *flag = ACTION_ARG(1); ChangeFlag(function, flag, 1, "SetFlag"); return 0; } @@ -1271,10 +1271,10 @@ %end-doc */ -static int ActionClrFlag(int argc, char **argv, Coord x, Coord y) +static int ActionClrFlag(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *flag = ACTION_ARG(1); + const char *function = ACTION_ARG(0); + const char *flag = ACTION_ARG(1); ChangeFlag(function, flag, 0, "ClrFlag"); return 0; } @@ -1311,11 +1311,11 @@ %end-doc */ -static int ActionSetValue(int argc, char **argv, Coord x, Coord y) +static int ActionSetValue(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *val = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *val = ACTION_ARG(1); + const char *units = ACTION_ARG(2); bool absolute; /* flag for 'absolute' value */ double value; int err = 0; Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 3142) +++ trunk/src/conf_act.c (revision 3143) @@ -42,12 +42,12 @@ static const char conf_help[] = "Perform various operations on the configuration tree."; extern lht_doc_t *conf_root[]; -static int ActionConf(int argc, char **argv, Coord x, Coord y) +static int ActionConf(int argc, const char **argv, Coord x, Coord y) { - char *cmd = argc > 0 ? argv[0] : 0; + const char *cmd = argc > 0 ? argv[0] : 0; if (NSTRCMP(cmd, "set") == 0) { - char *path, *val; + const char *path, *val; conf_policy_t pol = POL_OVERWRITE; conf_role_t role = CFR_invalid; int res; @@ -152,7 +152,7 @@ /*------------ get/chk (check flag actions for menus) ------------------*/ static const char GetStyle_syntax[] = "GetStyle()" ; static const char GetStyle_help[] = "Return integer index (>=0) of the currently active style or -1 if no style is selected (== custom style)"; -static int ActionGetStyle(int argc, char **argv, Coord x, Coord y) +static int ActionGetStyle(int argc, const char **argv, Coord x, Coord y) { return pcb_route_style_lookup(&PCB->RouteStyle, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL); } @@ -159,7 +159,7 @@ static const char ChkMode_syntax[] = "ChkMode(expected_mode)" ; static const char ChkMode_help[] = "Return 1 if the currently selected mode is the expected_mode"; -static int ActionChkMode(int argc, char **argv, Coord x, Coord y) +static int ActionChkMode(int argc, const char **argv, Coord x, Coord y) { #warning TODO: convert this to a compile-time hash struct { @@ -202,7 +202,7 @@ "ChkGridSize(none)\n" ; static const char ChkGridSize_help[] = "Return 1 if the currently selected grid matches the expected_size. If argument is \"none\" return 1 if there is no grid."; -static int ActionChkGridSize(int argc, char **argv, Coord x, Coord y) +static int ActionChkGridSize(int argc, const char **argv, Coord x, Coord y) { assert(argc == 1); if (strcmp(argv[0], "none") == 0) @@ -217,7 +217,7 @@ "ChkElementName(3) - expect value\n" ; static const char ChkElementName_help[] = "Return 1 if currently shown element label (name) type matches the expected"; -static int ActionChkElementName(int argc, char **argv, Coord x, Coord y) +static int ActionChkElementName(int argc, const char **argv, Coord x, Coord y) { int have, expected = argv[0][0] - '0'; @@ -231,7 +231,7 @@ static const char ChkGridUnits_syntax[] = "ChkGridUnits(expected)"; static const char ChkGridUnits_help[] = "Return 1 if currently selected grid unit matches the expected (normally mm or mil)"; -static int ActionChkGridUnits(int argc, char **argv, Coord x, Coord y) +static int ActionChkGridUnits(int argc, const char **argv, Coord x, Coord y) { assert(argc == 1); return strcmp(conf_core.editor.grid_unit->suffix, argv[0]) == 0; @@ -239,7 +239,7 @@ static const char ChkBuffer_syntax[] = "ChkBuffer(idx)"; static const char ChkBuffer_help[] = "Return 1 if currently selected buffer's index matches idx"; -static int ActionChkBuffer(int argc, char **argv, Coord x, Coord y) +static int ActionChkBuffer(int argc, const char **argv, Coord x, Coord y) { int expected = argv[0][0] - '0'; assert(argc == 1); Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 3142) +++ trunk/src/file_act.c (revision 3143) @@ -56,9 +56,9 @@ %end-doc */ -static int ActionExecCommand(int argc, char **argv, Coord x, Coord y) +static int ActionExecCommand(int argc, const char **argv, Coord x, Coord y) { - char *command; + const char *command; if (argc < 1) { AFAIL(execcommand); @@ -108,9 +108,9 @@ %end-doc */ -static int ActionLoadFrom(int argc, char **argv, Coord x, Coord y) +static int ActionLoadFrom(int argc, const char **argv, Coord x, Coord y) { - char *function, *name, *format = NULL; + const char *function, *name, *format = NULL; if (argc < 2) AFAIL(loadfrom); @@ -171,13 +171,14 @@ %end-doc */ -static int ActionNew(int argc, char **argv, Coord x, Coord y) +static int ActionNew(int argc, const char **argv, Coord x, Coord y) { - char *name = ACTION_ARG(0); + const char *argument_name = ACTION_ARG(0); + char *name = NULL; if (!PCB->Changed || gui->confirm_dialog(_("OK to clear layout data?"), 0)) { - if (name) - name = pcb_strdup(name); + if (argument_name) + name = pcb_strdup(argument_name); else name = gui->prompt_for(_("Enter the layout name:"), ""); @@ -244,11 +245,11 @@ %end-doc */ -static int ActionSaveTo(int argc, char **argv, Coord x, Coord y) +static int ActionSaveTo(int argc, const char **argv, Coord x, Coord y) { - char *function; - char *name; - char *fmt = NULL; + const char *function; + const char *name; + const char *fmt = NULL; function = argv[0]; name = argv[1]; @@ -337,9 +338,9 @@ %end-doc */ -static int ActionQuit(int argc, char **argv, Coord x, Coord y) +static int ActionQuit(int argc, const char **argv, Coord x, Coord y) { - char *force = ACTION_ARG(0); + const char *force = ACTION_ARG(0); if (force && strcasecmp(force, "force") == 0) { PCB->Changed = 0; exit(0); Index: trunk/src/find_act.c =================================================================== --- trunk/src/find_act.c (revision 3142) +++ trunk/src/find_act.c (revision 3143) @@ -43,7 +43,7 @@ %end-doc */ -static int ActionDRCheck(int argc, char **argv, Coord x, Coord y) +static int ActionDRCheck(int argc, const char **argv, Coord x, Coord y) { int count; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 3142) +++ trunk/src/gui_act.c (revision 3143) @@ -208,9 +208,9 @@ return shape; } -static int ActionDisplay(int argc, char **argv, Coord childX, Coord childY) +static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY) { - char *function, *str_dir; + const char *function, *str_dir; int id; int err = 0; @@ -589,9 +589,9 @@ %end-doc */ -static int ActionMode(int argc, char **argv, Coord x, Coord y) +static int ActionMode(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { Note.X = Crosshair.X; @@ -784,7 +784,7 @@ static const char cycledrag_help[] = "Cycle through which object is being dragged"; #define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (SLOP * pixel_slop)) : ((a)-(b) > -(SLOP * pixel_slop))) -static int ActionCycleDrag(int argc, char **argv, Coord x, Coord y) +static int ActionCycleDrag(int argc, const char **argv, Coord x, Coord y) { void *ptr1, *ptr2, *ptr3; int over = 0; @@ -861,7 +861,7 @@ %end-doc */ -static int ActionMessage(int argc, char **argv, Coord x, Coord y) +static int ActionMessage(int argc, const char **argv, Coord x, Coord y) { int i; @@ -889,9 +889,9 @@ %end-doc */ -static int ActionToggleHideName(int argc, char **argv, Coord x, Coord y) +static int ActionToggleHideName(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function && PCB->ElementOn) { switch (funchash_get(function, NULL)) { case F_Object: @@ -956,9 +956,9 @@ %end-doc */ -static int ActionMarkCrosshair(int argc, char **argv, Coord x, Coord y) +static int ActionMarkCrosshair(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (!function || !*function) { if (Marked.status) { notify_mark_change(false); @@ -994,9 +994,9 @@ %end-doc */ -static int ActionRouteStyle(int argc, char **argv, Coord x, Coord y) +static int ActionRouteStyle(int argc, const char **argv, Coord x, Coord y) { - char *str = ACTION_ARG(0); + const char *str = ACTION_ARG(0); RouteStyleType *rts; int number; @@ -1039,7 +1039,7 @@ %end-doc */ -static int ActionCreateMenu(int argc, char **argv, Coord x, Coord y) +static int ActionCreateMenu(int argc, const char **argv, Coord x, Coord y) { if (gui == NULL) { Message(PCB_MSG_DEFAULT, "Error: can't create menu, there's no GUI hid loaded\n"); @@ -1082,7 +1082,7 @@ pcb_use_route_style_idx(&PCB->RouteStyle, known); } -static int ActionSetSame(int argc, char **argv, Coord x, Coord y) +static int ActionSetSame(int argc, const char **argv, Coord x, Coord y) { void *ptr1, *ptr2, *ptr3; int type; @@ -1146,7 +1146,7 @@ %end-doc */ -static int ActionSwitchHID(int argc, char **argv, Coord x, Coord y) +static int ActionSwitchHID(int argc, const char **argv, Coord x, Coord y) { HID *ng = hid_find_gui(argv[0]); int chg; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 3142) +++ trunk/src/hid.h (revision 3143) @@ -76,7 +76,7 @@ /* Called when the action is triggered. If this function returns non-zero, no further actions will be invoked for this key/mouse event. */ - int (*trigger_cb) (int argc, char **argv, Coord x, Coord y); + int (*trigger_cb) (int argc, const char **argv, Coord x, Coord y); /* Short description that sometimes accompanies the name. */ const char *description; /* Full allowed syntax; use \n to separate lines. */ Index: trunk/src/hid_actions.c =================================================================== --- trunk/src/hid_actions.c (revision 3142) +++ trunk/src/hid_actions.c (revision 3143) @@ -219,7 +219,7 @@ int hid_actionl(const char *name, ...) { - char *argv[20]; + const char *argv[20]; int argc = 0; va_list ap; char *arg; @@ -231,7 +231,7 @@ return hid_actionv(name, argc, argv); } -int hid_actionv_(const HID_Action *a, int argc, char **argv) +int hid_actionv_(const HID_Action *a, int argc, const char **argv) { Coord x = 0, y = 0; int i, ret; @@ -255,7 +255,7 @@ return ret; } -int hid_actionv(const char *name, int argc, char **argv) +int hid_actionv(const char *name, int argc, const char **argv) { const HID_Action *a; @@ -278,7 +278,7 @@ static int hid_parse_actionstring(const char *rstr, char require_parens) { - char **list = NULL; + const char **list = NULL; int max = 0; int num; char *str = NULL; @@ -370,9 +370,9 @@ if (num >= max) { max += 10; if (list) - list = (char **) realloc(list, max * sizeof(char *)); + list = (const char **) realloc(list, max * sizeof(char *)); else - list = (char **) malloc(max * sizeof(char *)); + list = (const char **) malloc(max * sizeof(char *)); } /* Strip leading whitespace. */ while (*sp && isspace((int) *sp)) Index: trunk/src/hid_actions.h =================================================================== --- trunk/src/hid_actions.h (revision 3142) +++ trunk/src/hid_actions.h (revision 3143) @@ -17,8 +17,8 @@ int hid_action(const char *action_); int hid_actionl(const char *action_, ...); /* NULL terminated */ -int hid_actionv(const char *action_, int argc_, char **argv_); -int hid_actionv_(const HID_Action *a, int argc, char **argv); +int hid_actionv(const char *action_, int argc_, const char **argv_); +int hid_actionv_(const HID_Action *a, int argc, const char **argv); /* Parse the given command string into action calls, and call hid_actionv for each action found. Accepts both "action(arg1, Index: trunk/src/hid_flags.c =================================================================== --- trunk/src/hid_flags.c (revision 3142) +++ trunk/src/hid_flags.c (revision 3143) @@ -33,7 +33,7 @@ } else { char *end; - char *argv[2]; + const char *argv[2]; cp = strchr(name, '('); if (cp != NULL) { const HID_Action *a; @@ -87,4 +87,3 @@ for (i = 0; i < max_copper_layer + 2; i++) PCB->Data->Layer[i].On = save_array[i]; } - Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 3142) +++ trunk/src/main_act.c (revision 3143) @@ -44,7 +44,7 @@ static const char printactions_help[] = "Print all actions available."; -int ActionPrintActions(int argc, char **argv, Coord x, Coord y) +int ActionPrintActions(int argc, const char **argv, Coord x, Coord y) { print_actions(); return 0; @@ -55,7 +55,7 @@ static const char dumpactions_help[] = "Dump all actions available."; -int ActionDumpActions(int argc, char **argv, Coord x, Coord y) +int ActionDumpActions(int argc, const char **argv, Coord x, Coord y) { dump_actions(); return 0; @@ -146,7 +146,7 @@ return 0; } -int ActionPrintUsage(int argc, char **argv, Coord x, Coord y) +int ActionPrintUsage(int argc, const char **argv, Coord x, Coord y) { u(""); if (argc > 0) { @@ -178,7 +178,7 @@ static const char printversion_help[] = "Print version."; -int ActionPrintVersion(int argc, char **argv, Coord x, Coord y) +int ActionPrintVersion(int argc, const char **argv, Coord x, Coord y) { printf("PCB version %s\n", VERSION); return 0; @@ -189,7 +189,7 @@ static const char printcopyright_help[] = "Print copyright notice."; -int ActionPrintCopyright(int argc, char **argv, Coord x, Coord y) +int ActionPrintCopyright(int argc, const char **argv, Coord x, Coord y) { printf("\n" " COPYRIGHT for the original pcb program:\n\n" @@ -231,7 +231,7 @@ printf("\"\n"); } -int ActionPrintPaths(int argc, char **argv, Coord x, Coord y) +int ActionPrintPaths(int argc, const char **argv, Coord x, Coord y) { htsp_entry_t *e; conf_fields_foreach(e) { Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 3142) +++ trunk/src/misc.c (revision 3143) @@ -1288,7 +1288,7 @@ return dy > 0 ? 3 : 1; } -int ActionListRotations(int argc, char **argv, Coord x, Coord y) +int ActionListRotations(int argc, const char **argv, Coord x, Coord y) { ELEMENT_LOOP(PCB->Data); { Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 3142) +++ trunk/src/move.c (revision 3143) @@ -985,7 +985,7 @@ %end-doc */ -int MoveLayerAction(int argc, char **argv, Coord x, Coord y) +int MoveLayerAction(int argc, const char **argv, Coord x, Coord y) { int old_index, new_index; int new_top = -1; Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 3142) +++ trunk/src/netlist.c (revision 3143) @@ -355,7 +355,7 @@ %end-doc */ -static int ActionNetlist(int argc, char **argv, Coord x, Coord y) +static int ActionNetlist(int argc, const char **argv, Coord x, Coord y) { NFunc func; int i, j; Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 3142) +++ trunk/src/object_act.c (revision 3143) @@ -54,7 +54,7 @@ static ElementType *element_cache = NULL; -static ElementType *find_element_by_refdes(char *refdes) +static ElementType *find_element_by_refdes(const char *refdes) { if (element_cache && NAMEONPCB_NAME(element_cache) && strcmp(NAMEONPCB_NAME(element_cache), refdes) == 0) @@ -106,10 +106,10 @@ %end-doc */ -static int ActionAttributes(int argc, char **argv, Coord x, Coord y) +static int ActionAttributes(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *layername = ACTION_ARG(1); + const char *function = ACTION_ARG(0); + const char *layername = ACTION_ARG(1); char *buf; if (!function) @@ -214,9 +214,9 @@ #define GAP PCB_MIL_TO_COORD(100) -static int ActionDisperseElements(int argc, char **argv, Coord x, Coord y) +static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); Coord minx = GAP, miny = GAP, maxy = GAP, dx, dy; int all = 0, bad = 0; @@ -325,9 +325,9 @@ %end-doc */ -static int ActionFlip(int argc, char **argv, Coord x, Coord y) +static int ActionFlip(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); ElementTypePtr element; void *ptrtmp; int err = 0; @@ -372,11 +372,11 @@ %end-doc */ -static int ActionMoveObject(int argc, char **argv, Coord x, Coord y) +static int ActionMoveObject(int argc, const char **argv, Coord x, Coord y) { - char *x_str = ACTION_ARG(0); - char *y_str = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *x_str = ACTION_ARG(0); + const char *y_str = ACTION_ARG(1); + const char *units = ACTION_ARG(2); Coord nx, ny; bool absolute1, absolute2; void *ptr1, *ptr2, *ptr3; @@ -418,9 +418,9 @@ %end-doc */ -static int ActionMoveToCurrentLayer(int argc, char **argv, Coord x, Coord y) +static int ActionMoveToCurrentLayer(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_Object: @@ -485,12 +485,13 @@ return GetValue(as, NULL, NULL, NULL); } -static int ActionElementList(int argc, char **argv, Coord x, Coord y) +static int ActionElementList(int argc, const char **argv, Coord x, Coord y) { ElementType *e = NULL; - char *refdes, *value, *footprint, *old; - char *args[3]; - char *function = argv[0]; + const char *refdes, *value, *footprint; + const char *args[3]; + const char *function = argv[0]; + char *old; #ifdef DEBUG printf("Entered ActionElementList, executing function %s\n", function); @@ -660,10 +661,10 @@ %end-doc */ -static int ActionElementSetAttr(int argc, char **argv, Coord x, Coord y) +static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y) { ElementType *e = NULL; - char *refdes, *name, *value; + const char *refdes, *name, *value; AttributeType *attr; if (argc < 2) { @@ -729,9 +730,9 @@ %end-doc */ -static int ActionRipUp(int argc, char **argv, Coord x, Coord y) +static int ActionRipUp(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); bool changed = false; if (function) { @@ -833,11 +834,11 @@ %end-doc */ -static int ActionMinMaskGap(int argc, char **argv, Coord x, Coord y) +static int ActionMinMaskGap(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *delta = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *delta = ACTION_ARG(1); + const char *units = ACTION_ARG(2); bool absolute; Coord value; int flags; @@ -907,11 +908,11 @@ %end-doc */ -static int ActionMinClearGap(int argc, char **argv, Coord x, Coord y) +static int ActionMinClearGap(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); - char *delta = ACTION_ARG(1); - char *units = ACTION_ARG(2); + const char *function = ACTION_ARG(0); + const char *delta = ACTION_ARG(1); + const char *units = ACTION_ARG(2); bool absolute; Coord value; int flags; Index: trunk/src/plug_footprint_act.c =================================================================== --- trunk/src/plug_footprint_act.c (revision 3142) +++ trunk/src/plug_footprint_act.c (revision 3143) @@ -30,7 +30,7 @@ static const char fp_rehash_syntax[] = "fp_rehash()" ; static const char fp_rehash_help[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session."; -static int Action_fp_rehash(int argc, char **argv, Coord x, Coord y) +static int Action_fp_rehash(int argc, const char **argv, Coord x, Coord y) { fp_rehash(); return 0; Index: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c (revision 3142) +++ trunk/src/plugins.c (revision 3143) @@ -75,7 +75,7 @@ static const char manageplugins_help[] = "Manage plugins dialog."; -static int ManagePlugins(int argc, char **argv, Coord x, Coord y) +static int ActionManagePlugins(int argc, const char **argv, Coord x, Coord y) { plugin_info_t *i; int nump = 0, numb = 0; @@ -125,7 +125,7 @@ HID_Action plugins_action_list[] = { - {"ManagePlugins", 0, ManagePlugins, + {"ManagePlugins", 0, ActionManagePlugins, manageplugins_help, manageplugins_syntax} }; Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 3142) +++ trunk/src/polygon_act.c (revision 3143) @@ -53,9 +53,9 @@ %end-doc */ -static int ActionMorphPolygon(int argc, char **argv, Coord x, Coord y) +static int ActionMorphPolygon(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_Object: @@ -111,9 +111,9 @@ %end-doc */ -static int ActionPolygon(int argc, char **argv, Coord x, Coord y) +static int ActionPolygon(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function && conf_core.editor.mode == PCB_MODE_POLYGON) { notify_crosshair_change(false); switch (funchash_get(function, NULL)) { Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 3142) +++ trunk/src/rats_act.c (revision 3143) @@ -65,9 +65,9 @@ %end-doc */ -static int ActionAddRats(int argc, char **argv, Coord x, Coord y) +static int ActionAddRats(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); RatTypePtr shorty; float len, small; @@ -140,9 +140,9 @@ %end-doc */ -static int ActionConnection(int argc, char **argv, Coord x, Coord y) +static int ActionConnection(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { switch (funchash_get(function, NULL)) { case F_Find: @@ -189,9 +189,9 @@ %end-doc */ -static int ActionDeleteRats(int argc, char **argv, Coord x, Coord y) +static int ActionDeleteRats(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { if (conf_core.temp.rat_warn) ClearWarnings(); Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 3142) +++ trunk/src/rats_patch.c (revision 3143) @@ -365,10 +365,10 @@ static const char replacefootprint_help[] = "Replace the footprint of the selected components with the footprint specified."; -static int ReplaceFootprint(int argc, char **argv, Coord x, Coord y) +static int ActionReplaceFootprint(int argc, const char **argv, Coord x, Coord y) { - char *a[4]; - char *fpname; + const char *a[4]; + const char *fpname; int found = 0; /* check if we have elements selected and quit if not */ @@ -431,7 +431,7 @@ /* %start-doc actions SavePatch Save netlist patch for back annotation. %end-doc */ -static int SavePatch(int argc, char **argv, Coord x, Coord y) +static int ActionSavePatch(int argc, const char **argv, Coord x, Coord y) { const char *fn; FILE *f; @@ -472,10 +472,10 @@ } HID_Action rats_patch_action_list[] = { - {"ReplaceFootprint", 0, ReplaceFootprint, + {"ReplaceFootprint", 0, ActionReplaceFootprint, replacefootprint_help, replacefootprint_syntax} , - {"SavePatch", 0, SavePatch, + {"SavePatch", 0, ActionSavePatch, savepatch_help, savepatch_syntax} }; Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 3142) +++ trunk/src/remove_act.c (revision 3143) @@ -41,9 +41,9 @@ %end-doc */ -static int ActionDelete(int argc, char **argv, Coord x, Coord y) +static int ActionDelete(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); int id = funchash_get(function, NULL); Note.X = Crosshair.X; @@ -87,7 +87,7 @@ %end-doc */ -static int ActionRemoveSelected(int argc, char **argv, Coord x, Coord y) +static int ActionRemoveSelected(int argc, const char **argv, Coord x, Coord y) { if (RemoveSelected()) SetChangedFlag(true); Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 3142) +++ trunk/src/select_act.c (revision 3143) @@ -118,9 +118,9 @@ %end-doc */ -static int ActionSelect(int argc, char **argv, Coord x, Coord y) +static int ActionSelect(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { int type; @@ -149,7 +149,7 @@ commonByName: { - char *pattern = ACTION_ARG(1); + const char *pattern = ACTION_ARG(1); #warning "TODO: this should have a default value in case gui_get_pat() is not called" search_method_t method; @@ -157,7 +157,7 @@ if (SelectObjectByName(type, pattern, true, method)) SetChangedFlag(true); if (ACTION_ARG(1) == NULL) - free(pattern); + free((char*)pattern); } break; } @@ -278,9 +278,9 @@ %end-doc */ -static int ActionUnselect(int argc, char **argv, Coord x, Coord y) +static int ActionUnselect(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (function) { int type; switch (funchash_get(function, NULL)) { @@ -309,7 +309,7 @@ commonByName: { - char *pattern = ACTION_ARG(1); + const char *pattern = ACTION_ARG(1); #warning "TODO: this should have a default value in case gui_get_pat() is not called" search_method_t method; @@ -317,7 +317,7 @@ if (SelectObjectByName(type, pattern, false, method)) SetChangedFlag(true); if (ACTION_ARG(1) == NULL) - free(pattern); + free((char*)pattern); } break; } Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 3142) +++ trunk/src/undo.h (revision 3143) @@ -68,8 +68,8 @@ bool Undoing(void); /* Publish actions - these may be useful for other actions */ -int ActionUndo(int argc, char **argv, Coord x, Coord y); -int ActionRedo(int argc, char **argv, Coord x, Coord y); -int ActionAtomic(int argc, char **argv, Coord x, Coord y); +int ActionUndo(int argc, const char **argv, Coord x, Coord y); +int ActionRedo(int argc, const char **argv, Coord x, Coord y); +int ActionAtomic(int argc, const char **argv, Coord x, Coord y); #endif Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 3142) +++ trunk/src/undo_act.c (revision 3143) @@ -79,7 +79,7 @@ %end-doc */ -int ActionAtomic(int argc, char **argv, Coord x, Coord y) +int ActionAtomic(int argc, const char **argv, Coord x, Coord y) { if (argc != 1) AFAIL(atomic); @@ -125,9 +125,9 @@ %end-doc */ -int ActionUndo(int argc, char **argv, Coord x, Coord y) +int ActionUndo(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); if (!function || !*function) { /* don't allow undo in the middle of an operation */ if (conf_core.editor.mode != PCB_MODE_POLYGON_HOLE && Crosshair.AttachedObject.State != STATE_FIRST) @@ -265,7 +265,7 @@ %end-doc */ -int ActionRedo(int argc, char **argv, Coord x, Coord y) +int ActionRedo(int argc, const char **argv, Coord x, Coord y) { if (((conf_core.editor.mode == PCB_MODE_POLYGON || conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && Crosshair.AttachedPolygon.PointN) || Crosshair.AttachedLine.State == STATE_SECOND) Index: trunk/src_plugins/autoplace/action.c =================================================================== --- trunk/src_plugins/autoplace/action.c (revision 3142) +++ trunk/src_plugins/autoplace/action.c (revision 3143) @@ -43,7 +43,7 @@ %end-doc */ -static int ActionAutoPlaceSelected(int argc, char **argv, Coord x, Coord y) +static int ActionAutoPlaceSelected(int argc, const char **argv, Coord x, Coord y) { hid_action("Busy"); if (gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) { Index: trunk/src_plugins/autoroute/action.c =================================================================== --- trunk/src_plugins/autoroute/action.c (revision 3142) +++ trunk/src_plugins/autoroute/action.c (revision 3143) @@ -63,9 +63,9 @@ %end-doc */ -static int ActionAutoRoute(int argc, char **argv, Coord x, Coord y) +static int ActionAutoRoute(int argc, const char **argv, Coord x, Coord y) { - char *function = ACTION_ARG(0); + const char *function = ACTION_ARG(0); hid_action("Busy"); if (function) { /* one parameter */ if (strcmp(function, "AllRats") == 0) { Index: trunk/src_plugins/dbus/dbus.c =================================================================== --- trunk/src_plugins/dbus/dbus.c (revision 3142) +++ trunk/src_plugins/dbus/dbus.c (revision 3143) @@ -150,7 +150,7 @@ #endif /* TODO: Proper return value from actions */ - hid_actionv(action_name, argc, argv); + hid_actionv(action_name, argc, (const char**)argv); retval = 0; dbus_free_string_array(argv); Index: trunk/src_plugins/debug/debug.c =================================================================== --- trunk/src_plugins/debug/debug.c (revision 3142) +++ trunk/src_plugins/debug/debug.c (revision 3143) @@ -42,9 +42,9 @@ static const char conf_help[] = "Perform various operations on the configuration tree."; extern lht_doc_t *conf_root[]; -static int ActionDumpConf(int argc, char **argv, Coord x, Coord y) +static int ActionDumpConf(int argc, const char **argv, Coord x, Coord y) { - char *cmd = argc > 0 ? argv[0] : 0; + const char *cmd = argc > 0 ? argv[0] : NULL; if (NSTRCMP(cmd, "native") == 0) { int verbose; @@ -90,7 +90,7 @@ static const char dump_layers_help[] = "Print info about each layer"; extern lht_doc_t *conf_root[]; -static int ActionDumpLayers(int argc, char **argv, Coord x, Coord y) +static int ActionDumpLayers(int argc, const char **argv, Coord x, Coord y) { int g, n, used, arr[128]; /* WARNING: this assumes we won't have more than 128 layers */ Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 3142) +++ trunk/src_plugins/djopt/djopt.c (revision 3143) @@ -2546,9 +2546,9 @@ %end-doc */ -static int ActionDJopt(int argc, char **argv, Coord x, Coord y) +static int ActionDJopt(int argc, const char **argv, Coord x, Coord y) { - char *arg = argc > 0 ? argv[0] : 0; + const char *arg = argc > 0 ? argv[0] : NULL; int layn, saved = 0; corner_s *c; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 3142) +++ trunk/src_plugins/export_ps/ps.c (revision 3143) @@ -1542,7 +1542,7 @@ { } -static int ActionPSCalib(int argc, char **argv, Coord x, Coord y) +static int ActionPSCalib(int argc, const char **argv, Coord x, Coord y) { ps_calibrate(0.0, 0.0); return 0; Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 3142) +++ trunk/src_plugins/fontmode/fontmode.c (revision 3143) @@ -69,7 +69,7 @@ %end-doc */ -static int FontEdit(int argc, char **argv, Coord Ux, Coord Uy) +static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy) { FontType *font; SymbolType *symbol; @@ -158,7 +158,7 @@ %end-doc */ -static int FontSave(int argc, char **argv, Coord Ux, Coord Uy) +static int FontSave(int argc, const char **argv, Coord Ux, Coord Uy) { FontTypePtr font; SymbolTypePtr symbol; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 3142) +++ trunk/src_plugins/hid_batch/batch.c (revision 3143) @@ -48,12 +48,12 @@ free(prompt); } -static int nop(int argc, char **argv, Coord x, Coord y) +static int nop(int argc, const char **argv, Coord x, Coord y) { return 0; } -static int PCBChanged(int argc, char **argv, Coord x, Coord y) +static int PCBChanged(int argc, const char **argv, Coord x, Coord y) { if (prompt != NULL) free(prompt); @@ -71,13 +71,13 @@ return 0; } -static int help(int argc, char **argv, Coord x, Coord y) +static int help(int argc, const char **argv, Coord x, Coord y) { print_actions(); return 0; } -static int info(int argc, char **argv, Coord x, Coord y) +static int info(int argc, const char **argv, Coord x, Coord y) { int i, j; int cg, sg; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3142) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3143) @@ -185,7 +185,7 @@ %end-doc */ -static int Zoom(int argc, char **argv, Coord x, Coord y) +static int Zoom(int argc, const char **argv, Coord x, Coord y) { const char *vp; double v; @@ -1008,7 +1008,7 @@ %end-doc */ -static int About(int argc, char **argv, Coord x, Coord y) +static int About(int argc, const char **argv, Coord x, Coord y) { ghid_dialog_about(); return 0; @@ -1025,7 +1025,7 @@ %end-doc */ -static int GetXY(int argc, char **argv, Coord x, Coord y) +static int GetXY(int argc, const char **argv, Coord x, Coord y) { return 0; } @@ -1032,7 +1032,7 @@ /* ---------------------------------------------------------------------- */ -static int PointCursor(int argc, char **argv, Coord x, Coord y) +static int PointCursor(int argc, const char **argv, Coord x, Coord y) { if (!ghidgui) return 0; @@ -1046,7 +1046,7 @@ /* ---------------------------------------------------------------------- */ -static int RouteStylesChanged(int argc, char **argv, Coord x, Coord y) +static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y) { if (!ghidgui || !ghidgui->route_style_selector) return 0; @@ -1060,7 +1060,7 @@ /* ---------------------------------------------------------------------- */ -int PCBChanged(int argc, char **argv, Coord x, Coord y) +int PCBChanged(int argc, const char **argv, Coord x, Coord y) { if (!ghidgui) return 0; @@ -1085,7 +1085,7 @@ /* ---------------------------------------------------------------------- */ -static int LayerGroupsChanged(int argc, char **argv, Coord x, Coord y) +static int LayerGroupsChanged(int argc, const char **argv, Coord x, Coord y) { printf(_("LayerGroupsChanged -- not implemented\n")); return 0; @@ -1093,7 +1093,7 @@ /* ---------------------------------------------------------------------- */ -static int LibraryChanged(int argc, char **argv, Coord x, Coord y) +static int LibraryChanged(int argc, const char **argv, Coord x, Coord y) { /* No need to show the library window every time it changes... * ghid_library_window_show (&ghid_port, FALSE); @@ -1103,7 +1103,7 @@ /* ---------------------------------------------------------------------- */ -static int Command(int argc, char **argv, Coord x, Coord y) +static int Command(int argc, const char **argv, Coord x, Coord y) { ghid_handle_user_command(TRUE); return 0; @@ -1121,9 +1121,9 @@ return pcb_strdup(getcwd(tmp, sizeof(tmp))); } -static int Load(int argc, char **argv, Coord x, Coord y) +static int Load(int argc, const char **argv, Coord x, Coord y) { - char *function; + const char *function; char *name = NULL; static gchar *current_element_dir = NULL; @@ -1141,7 +1141,7 @@ if (argc > 1) return hid_actionv("LoadFrom", argc, argv); - function = argc ? argv[0] : (char *) "Layout"; + function = argc ? argv[0] : "Layout"; if (strcasecmp(function, "Netlist") == 0) { name = ghid_dialog_file_select_open(_("Load netlist file"), ¤t_netlist_dir, conf_core.rc.file_path); @@ -1184,9 +1184,9 @@ %end-doc */ -static int Save(int argc, char **argv, Coord x, Coord y) +static int Save(int argc, const char **argv, Coord x, Coord y) { - char *function; + const char *function; char *name; char *prompt; pcb_io_formats_t avail; @@ -1201,7 +1201,7 @@ if (argc > 1) return hid_actionv("SaveTo", argc, argv); - function = argc ? argv[0] : (char *) "Layout"; + function = argc ? argv[0] : "Layout"; if (strcasecmp(function, "Layout") == 0) if (PCB->Filename) @@ -1305,7 +1305,7 @@ %end-doc */ -static int SwapSides(int argc, char **argv, Coord x, Coord y) +static int SwapSides(int argc, const char **argv, Coord x, Coord y) { int active_group = GetLayerGroupNumberByNumber(LayerStack[0]); int comp_group = GetLayerGroupNumberByNumber(component_silk_layer); @@ -1358,7 +1358,7 @@ %end-doc */ -static int Print(int argc, char **argv, Coord x, Coord y) +static int Print(int argc, const char **argv, Coord x, Coord y) { HID **hids; int i; @@ -1410,7 +1410,7 @@ %end-doc */ -static int PrintCalibrate(int argc, char **argv, Coord x, Coord y) +static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y) { HID *printer = hid_find_printer(); printer->calibrate(0.0, 0.0); @@ -1425,7 +1425,7 @@ /* ------------------------------------------------------------ */ -static int Export(int argc, char **argv, Coord x, Coord y) +static int Export(int argc, const char **argv, Coord x, Coord y) { /* check if layout is empty */ @@ -1440,7 +1440,7 @@ /* ------------------------------------------------------------ */ -static int Benchmark(int argc, char **argv, Coord x, Coord y) +static int Benchmark(int argc, const char **argv, Coord x, Coord y) { int i = 0; time_t start, end; @@ -1476,7 +1476,7 @@ %end-doc */ -static int Center(int argc, char **argv, Coord pcb_x, Coord pcb_y) +static int Center(int argc, const char **argv, Coord pcb_x, Coord pcb_y) { GdkDisplay *display; GdkScreen *screen; @@ -1552,7 +1552,7 @@ %end-doc */ -static int CursorAction(int argc, char **argv, Coord x, Coord y) +static int CursorAction(int argc, const char **argv, Coord x, Coord y) { UnitList extra_units_x = { {"grid", PCB->Grid, 0}, @@ -1631,9 +1631,9 @@ %end-doc */ -static int DoWindows(int argc, char **argv, Coord x, Coord y) +static int DoWindows(int argc, const char **argv, Coord x, Coord y) { - char *a = argc == 1 ? argv[0] : (char *) ""; + const char *a = argc == 1 ? argv[0] : ""; if (strcmp(a, "1") == 0 || strcasecmp(a, "Layout") == 0) { } @@ -1678,7 +1678,7 @@ %end-doc */ -static int SetUnits(int argc, char **argv, Coord x, Coord y) +static int SetUnits(int argc, const char **argv, Coord x, Coord y) { const Unit *new_unit; if (argc == 0) @@ -1718,7 +1718,7 @@ %end-doc */ -static int ScrollAction(int argc, char **argv, Coord x, Coord y) +static int ScrollAction(int argc, const char **argv, Coord x, Coord y) { gdouble dx = 0.0, dy = 0.0; int div = 40; @@ -1761,7 +1761,7 @@ %end-doc */ -static int PanAction(int argc, char **argv, Coord x, Coord y) +static int PanAction(int argc, const char **argv, Coord x, Coord y) { int mode; @@ -1797,7 +1797,7 @@ in the popups subtree in the menu lht file. %end-doc */ -static int Popup(int argc, char **argv, Coord x, Coord y) +static int Popup(int argc, const char **argv, Coord x, Coord y) { GtkMenu *menu = NULL; char name[256]; @@ -1837,7 +1837,7 @@ %end-doc */ -static int ImportGUI(int argc, char **argv, Coord x, Coord y) +static int ImportGUI(int argc, const char **argv, Coord x, Coord y) { char *name = NULL; static gchar *current_layout_dir = NULL; @@ -1872,7 +1872,7 @@ static const char savewingeo_help[] = N_("Saves window geometry in the config.\n"); -static int SaveWinGeo(int argc, char **argv, Coord x, Coord y) +static int SaveWinGeo(int argc, const char **argv, Coord x, Coord y) { ghid_wgeo_save(1, 0); return 0; @@ -1881,7 +1881,7 @@ /* ------------------------------------------------------------ */ -static int Busy(int argc, char **argv, Coord x, Coord y) +static int Busy(int argc, const char **argv, Coord x, Coord y) { ghid_watch_cursor(); return 0; Index: trunk/src_plugins/hid_gtk/gui-log-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-log-window.c (revision 3142) +++ trunk/src_plugins/hid_gtk/gui-log-window.c (revision 3143) @@ -179,9 +179,9 @@ to it. If false, the log will still be updated, but the window won't \ be shown."; -static gint GhidLogShowOnAppend(int argc, char **argv, Coord x, Coord y) +static gint GhidLogShowOnAppend(int argc, const char **argv, Coord x, Coord y) { - char *a = argc == 1 ? argv[0] : (char *) ""; + const char *a = argc == 1 ? argv[0] : ""; if (strncasecmp(a, "t", 1) == 0) { log_show_on_append = TRUE; Index: trunk/src_plugins/hid_gtk/gui-netlist-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 3142) +++ trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 3143) @@ -921,7 +921,7 @@ node_model_update((&PCB->NetlistLib[NETLIST_EDITED])->Menu); } -static gint GhidNetlistChanged(int argc, char **argv, Coord x, Coord y) +static gint GhidNetlistChanged(int argc, const char **argv, Coord x, Coord y) { loading_new_netlist = TRUE; ghid_netlist_window_update(TRUE); @@ -935,7 +935,7 @@ static const char netlistshow_help[] = "Selects the given pinname or netname in the netlist window. Does not \ show the window if it isn't already shown."; -static gint GhidNetlistShow(int argc, char **argv, Coord x, Coord y) +static gint GhidNetlistShow(int argc, const char **argv, Coord x, Coord y) { ghid_netlist_window_create(gport); if (argc > 0) @@ -947,7 +947,7 @@ static const char netlistpresent_help[] = "Presents the netlist window."; -static gint GhidNetlistPresent(int argc, char **argv, Coord x, Coord y) +static gint GhidNetlistPresent(int argc, const char **argv, Coord x, Coord y) { ghid_netlist_window_show(gport, TRUE); return 0; Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 3142) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 3143) @@ -1501,7 +1501,7 @@ return visible; } -gint LayersChanged(int argc, char **argv, Coord x, Coord y) +gint LayersChanged(int argc, const char **argv, Coord x, Coord y) { if (!ghidgui || !ghidgui->menu_bar) return 0; @@ -1537,7 +1537,7 @@ %end-doc */ -static int ToggleView(int argc, char **argv, Coord x, Coord y) +static int ToggleView(int argc, const char **argv, Coord x, Coord y) { int i, l; @@ -1594,7 +1594,7 @@ %end-doc */ -static int SelectLayer(int argc, char **argv, Coord x, Coord y) +static int SelectLayer(int argc, const char **argv, Coord x, Coord y) { int newl; if (argc == 0) @@ -1685,7 +1685,7 @@ %end-doc */ -static int AdjustStyle(int argc, char **argv, Coord x, Coord y) +static int AdjustStyle(int argc, const char **argv, Coord x, Coord y) { if (argc > 1) AFAIL(adjuststyle); @@ -1708,7 +1708,7 @@ %end-doc */ -static int EditLayerGroups(int argc, char **argv, Coord x, Coord y) +static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y) { if (argc != 0) Index: trunk/src_plugins/hid_gtk/gui.h =================================================================== --- trunk/src_plugins/hid_gtk/gui.h (revision 3142) +++ trunk/src_plugins/hid_gtk/gui.h (revision 3143) @@ -445,7 +445,7 @@ /* gtkhid-main.c */ void ghid_pan_view_rel(Coord dx, Coord dy); void ghid_get_coords(const char *msg, Coord * x, Coord * y); -gint PCBChanged(int argc, char **argv, Coord x, Coord y); +gint PCBChanged(int argc, const char **argv, Coord x, Coord y); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 3143) @@ -91,7 +91,7 @@ %end-doc */ -static int Load(int argc, char **argv, Coord x, Coord y) +static int Load(int argc, const char **argv, Coord x, Coord y) { const char *function; char *name; @@ -149,7 +149,7 @@ %end-doc */ -static int LoadVendor(int argc, char **argv, Coord x, Coord y) +static int LoadVendor(int argc, const char **argv, Coord x, Coord y) { char *name; XmString xmname, pattern; @@ -202,7 +202,7 @@ %end-doc */ -static int Save(int argc, char **argv, Coord x, Coord y) +static int Save(int argc, const char **argv, Coord x, Coord y) { const char *function; char *name; @@ -361,7 +361,7 @@ static Widget confirm_dialog = 0; static Widget confirm_cancel, confirm_ok, confirm_label; -int lesstif_confirm_dialog(char *msg, ...) +int lesstif_confirm_dialog(const char *msg, ...) { char *cancelmsg, *okmsg; va_list ap; @@ -420,7 +420,7 @@ return ok; } -static int ConfirmAction(int argc, char **argv, Coord x, Coord y) +static int ConfirmAction(int argc, const char **argv, Coord x, Coord y) { int rv = lesstif_confirm_dialog(argc > 0 ? argv[0] : 0, argc > 1 ? argv[1] : 0, @@ -543,7 +543,7 @@ %end-doc */ -static int PromptFor(int argc, char **argv, Coord x, Coord y) +static int PromptFor(int argc, const char **argv, Coord x, Coord y) { char *rv = lesstif_prompt_for(argc > 0 ? argv[0] : 0, argc > 1 ? argv[1] : 0); @@ -822,7 +822,7 @@ %end-doc */ -static int DoWindows(int argc, char **argv, Coord x, Coord y) +static int DoWindows(int argc, const char **argv, Coord x, Coord y) { const char *a = argc == 1 ? argv[0] : ""; if (strcmp(a, "1") == 0 || strcasecmp(a, "Layout") == 0) { @@ -858,7 +858,7 @@ %end-doc */ -static int About(int argc, char **argv, Coord x, Coord y) +static int About(int argc, const char **argv, Coord x, Coord y) { static Widget about = 0; if (!about) { @@ -887,7 +887,7 @@ %end-doc */ -static int Print(int argc, char **argv, Coord x, Coord y) +static int Print(int argc, const char **argv, Coord x, Coord y) { HID_Attribute *opts; HID *printer; @@ -932,7 +932,7 @@ %end-doc */ -static int PrintCalibrate(int argc, char **argv, Coord x, Coord y) +static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y) { HID *printer = hid_find_printer(); printer->calibrate(0.0, 0.0); @@ -955,7 +955,7 @@ %end-doc */ -static int Export(int argc, char **argv, Coord x, Coord y) +static int Export(int argc, const char **argv, Coord x, Coord y) { static Widget selector = 0; HID_Attribute *opts; @@ -1137,7 +1137,7 @@ %end-doc */ -static int AdjustSizes(int argc, char **argv, Coord x, Coord y) +static int AdjustSizes(int argc, const char **argv, Coord x, Coord y) { if (!sizes_dialog) { Widget inf, sep; @@ -1438,7 +1438,7 @@ %end-doc */ -static int EditLayerGroups(int argc, char **argv, Coord x, Coord y) +static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y) { if (!layer_groups_form) { @@ -1832,7 +1832,7 @@ %end-doc */ -static int ImportGUI(int argc, char **argv, Coord x, Coord y) +static int ImportGUI(int argc, const char **argv, Coord x, Coord y) { static int I_am_recursing = 0; static XmString xms_sch = 0, xms_import = 0; Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/library.c (revision 3143) @@ -126,7 +126,7 @@ lib_dfs(l, level+1); } -static int LibraryChanged(int argc, char **argv, Coord x, Coord y) +static int LibraryChanged(int argc, const char **argv, Coord x, Coord y) { int i; if (library.data.dir.children.used == 0) @@ -167,7 +167,7 @@ %end-doc */ -static int LibraryShow(int argc, char **argv, Coord x, Coord y) +static int LibraryShow(int argc, const char **argv, Coord x, Coord y) { if (build_library_dialog()) return 0; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/main.c (revision 3143) @@ -310,7 +310,7 @@ /* Called from the core when it's busy doing something and we need to indicate that to the user. */ -static int Busy(int argc, char **argv, Coord x, Coord y) +static int Busy(int argc, const char **argv, Coord x, Coord y) { static Cursor busy_cursor = 0; if (busy_cursor == 0) @@ -325,7 +325,7 @@ /* Local actions. */ -static int PointCursor(int argc, char **argv, Coord x, Coord y) +static int PointCursor(int argc, const char **argv, Coord x, Coord y) { if (argc > 0) over_point = 1; @@ -335,7 +335,7 @@ return 0; } -static int PCBChanged(int argc, char **argv, Coord x, Coord y) +static int PCBChanged(int argc, const char **argv, Coord x, Coord y) { if (work_area == 0) return 0; @@ -389,7 +389,7 @@ %end-doc */ -static int SetUnits(int argc, char **argv, Coord x, Coord y) +static int SetUnits(int argc, const char **argv, Coord x, Coord y) { const Unit *new_unit; if (argc == 0) @@ -449,7 +449,7 @@ %end-doc */ -static int ZoomAction(int argc, char **argv, Coord x, Coord y) +static int ZoomAction(int argc, const char **argv, Coord x, Coord y) { const char *vp; double v; @@ -494,7 +494,7 @@ static int pan_thumb_mode; -static int PanAction(int argc, char **argv, Coord x, Coord y) +static int PanAction(int argc, const char **argv, Coord x, Coord y) { int mode; @@ -563,7 +563,7 @@ return 0; } -static int SwapSides(int argc, char **argv, Coord x, Coord y) +static int SwapSides(int argc, const char **argv, Coord x, Coord y) { int old_shown_side = conf_core.editor.show_solder_side; int comp_group = GetLayerGroupNumberByNumber(component_silk_layer); @@ -716,7 +716,7 @@ %end-doc */ -static int Command(int argc, char **argv, Coord x, Coord y) +static int Command(int argc, const char **argv, Coord x, Coord y) { XtManageChild(m_cmd_label); XtManageChild(m_cmd); @@ -736,7 +736,7 @@ %end-doc */ -static int Benchmark(int argc, char **argv, Coord x, Coord y) +static int Benchmark(int argc, const char **argv, Coord x, Coord y) { int i = 0; time_t start, end; @@ -769,7 +769,7 @@ return 0; } -static int Center(int argc, char **argv, Coord x, Coord y) +static int Center(int argc, const char **argv, Coord x, Coord y) { x = GridFit(x, PCB->Grid, PCB->GridOffsetX); y = GridFit(y, PCB->Grid, PCB->GridOffsetY); @@ -822,7 +822,7 @@ %end-doc */ -static int CursorAction(int argc, char **argv, Coord x, Coord y) +static int CursorAction(int argc, const char **argv, Coord x, Coord y) { UnitList extra_units_x = { {"grid", PCB->Grid, 0}, Index: trunk/src_plugins/hid_lesstif/menu.c =================================================================== --- trunk/src_plugins/hid_lesstif/menu.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/menu.c (revision 3143) @@ -52,7 +52,7 @@ %end-doc */ -static int GetXY(int argc, char **argv, Coord x, Coord y) +static int GetXY(int argc, const char **argv, Coord x, Coord y) { return 0; } @@ -81,7 +81,7 @@ extern Widget lesstif_m_layer; -static int LayersChanged(int argc, char **argv, Coord x, Coord y) +static int LayersChanged(int argc, const char **argv, Coord x, Coord y) { int l, i, set; const char *name; @@ -312,7 +312,7 @@ %end-doc */ -static int SelectLayer(int argc, char **argv, Coord x, Coord y) +static int SelectLayer(int argc, const char **argv, Coord x, Coord y) { int newl; if (argc == 0) @@ -345,7 +345,7 @@ %end-doc */ -static int ToggleView(int argc, char **argv, Coord x, Coord y) +static int ToggleView(int argc, const char **argv, Coord x, Coord y) { int i, l; Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 3143) @@ -32,7 +32,7 @@ static int n_netnode_strings; static int last_pick = -1; -static int LesstifNetlistChanged(int argc, char **argv, Coord x, Coord y); +static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y); static void pick_net(int pick) { @@ -343,7 +343,7 @@ return 0; } -static int LesstifNetlistChanged(int argc, char **argv, Coord x, Coord y) +static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y) { int i; if (!PCB->NetlistLib[NETLIST_EDITED].MenuN) @@ -372,7 +372,7 @@ %end-doc */ -static int LesstifNetlistShow(int argc, char **argv, Coord x, Coord y) +static int LesstifNetlistShow(int argc, const char **argv, Coord x, Coord y) { if (build_netlist_dialog()) return 0; Index: trunk/src_plugins/hid_lesstif/styles.c =================================================================== --- trunk/src_plugins/hid_lesstif/styles.c (revision 3142) +++ trunk/src_plugins/hid_lesstif/styles.c (revision 3143) @@ -83,7 +83,7 @@ "Thickness", "Diameter", "Hole", "Clearance" }; -static int RouteStylesChanged(int argc, char **argv, Coord x, Coord y); +static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y); static void update_one_value(int i, Coord v) { @@ -312,7 +312,7 @@ %end-doc */ -static int AdjustStyle(int argc, char **argv, Coord x, Coord y) +static int AdjustStyle(int argc, const char **argv, Coord x, Coord y) { if (!mainwind) return 1; @@ -375,7 +375,7 @@ return 0; } -static int RouteStylesChanged(int argc, char **argv, Coord x, Coord y) +static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y) { int i, j, h; if (!PCB || vtroutestyle_len(&PCB->RouteStyle) == 0) Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 3142) +++ trunk/src_plugins/import_sch/import_sch.c (revision 3143) @@ -50,7 +50,7 @@ conf_import_sch_t conf_import_sch; -extern int ActionExecuteFile(int argc, char **argv, Coord x, Coord y); +extern int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y); /* ---------------------------------------------------------------- */ static const char import_syntax[] = @@ -171,10 +171,10 @@ %end-doc */ -static int ActionImport(int argc, char **argv, Coord x, Coord y) +static int ActionImport(int argc, const char **argv, Coord x, Coord y) { - char *mode; - char **sources = NULL; + const char *mode; + const char **sources = NULL; int nsources = 0; #ifdef DEBUG @@ -184,7 +184,7 @@ mode = ACTION_ARG(0); if (mode && strcasecmp(mode, "setdisperse") == 0) { - char *ds, *units; + const char *ds, *units; char buf[50]; ds = ACTION_ARG(1); @@ -200,7 +200,7 @@ else AttributePut(PCB, "import::disperse", ds); if (ACTION_ARG(1) == NULL) - free(ds); + free((char*)ds); return 0; } @@ -265,7 +265,7 @@ } while (src); if (nsources > 0) { - sources = (char **) malloc((nsources + 1) * sizeof(char *)); + sources = (const char **) malloc((nsources + 1) * sizeof(char *)); nsources = -1; do { nsources++; @@ -301,7 +301,7 @@ if (access(schname, F_OK)) return hid_action("ImportGUI"); - sources = (char **) malloc(2 * sizeof(char *)); + sources = (const char **) malloc(2 * sizeof(char *)); sources[0] = schname; sources[1] = NULL; nsources = 1; @@ -309,7 +309,7 @@ if (strcasecmp(mode, "gnetlist") == 0) { char *tmpfile = tempfile_name_new("gnetlist_output"); - char **cmd; + const char **cmd; int i; if (tmpfile == NULL) { @@ -317,7 +317,7 @@ return 1; } - cmd = (char **) malloc((7 + nsources) * sizeof(char *)); + cmd = (const char **) malloc((7 + nsources) * sizeof(char *)); cmd[0] = conf_import_sch.plugins.import_sch.gnetlist_program; cmd[1] = "-g"; cmd[2] = "pcbfwd"; @@ -352,7 +352,7 @@ else if (strcasecmp(mode, "make") == 0) { int must_free_tmpfile = 0; char *tmpfile; - char *cmd[10]; + const char *cmd[10]; int i; char *srclist; int srclen; @@ -405,9 +405,9 @@ if (pcb_spawnvp(cmd)) { if (must_free_tmpfile) unlink(tmpfile); - free(cmd[2]); - free(cmd[3]); - free(cmd[4]); + free((char*)cmd[2]); + free((char*)cmd[3]); + free((char*)cmd[4]); return 1; } @@ -415,9 +415,9 @@ cmd[1] = NULL; ActionExecuteFile(1, cmd, 0, 0); - free(cmd[2]); - free(cmd[3]); - free(cmd[4]); + free((char*)cmd[2]); + free((char*)cmd[3]); + free((char*)cmd[4]); if (must_free_tmpfile) tempfile_unlink(tmpfile); } Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 3142) +++ trunk/src_plugins/oldactions/oldactions.c (revision 3143) @@ -62,7 +62,7 @@ %end-doc */ -static int ActionDumpLibrary(int argc, char **argv, Coord x, Coord y) +static int ActionDumpLibrary(int argc, const char **argv, Coord x, Coord y) { #warning TODO: rewrite this code for the plug_footprint library_t /* int i, j; @@ -96,7 +96,7 @@ static const char bell_help[] = "Attempt to produce audible notification (e.g. beep the speaker)."; -static int ActionBell(int argc, char **argv, Coord x, Coord y) +static int ActionBell(int argc, const char **argv, Coord x, Coord y) { gui->beep(); return 0; @@ -127,7 +127,7 @@ %end-doc */ -static int Debug(int argc, char **argv, Coord x, Coord y) +static int Debug(int argc, const char **argv, Coord x, Coord y) { int i; printf("Debug:"); @@ -148,7 +148,7 @@ %end-doc */ -static int Return(int argc, char **argv, Coord x, Coord y) +static int Return(int argc, const char **argv, Coord x, Coord y) { return atoi(argv[0]); } @@ -172,7 +172,7 @@ -int djopt_set_auto_only(int argc, char **argv, Coord x, Coord y) +int djopt_set_auto_only(int argc, const char **argv, Coord x, Coord y) { conf_toggle(CFR_DESIGN, "plugins/djopt/auto_only"); return 0; @@ -198,7 +198,7 @@ %end-doc */ -int ActionToggleVendor(int argc, char **argv, Coord x, Coord y) +int ActionToggleVendor(int argc, const char **argv, Coord x, Coord y) { conf_toggle(CFR_DESIGN, "plugins/vendor/enable"); return 0; @@ -224,7 +224,7 @@ %end-doc */ -int ActionEnableVendor(int argc, char **argv, Coord x, Coord y) +int ActionEnableVendor(int argc, const char **argv, Coord x, Coord y) { conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); return 0; @@ -248,7 +248,7 @@ %end-doc */ -int ActionDisableVendor(int argc, char **argv, Coord x, Coord y) +int ActionDisableVendor(int argc, const char **argv, Coord x, Coord y) { conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); return 0; Index: trunk/src_plugins/propedit/propedit.c =================================================================== --- trunk/src_plugins/propedit/propedit.c (revision 3142) +++ trunk/src_plugins/propedit/propedit.c (revision 3143) @@ -40,7 +40,7 @@ TODO %end-doc */ -int propedit_action(int argc, char **argv, Coord x, Coord y) +int propedit_action(int argc, const char **argv, Coord x, Coord y) { pe_ctx_t ctx; ctx.core_props = pcb_props_init(); @@ -105,4 +105,3 @@ REGISTER_ACTIONS(propedit_action_list, propedit_cookie) return hid_propedit_uninit; } - Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 3142) +++ trunk/src_plugins/puller/puller.c (revision 3143) @@ -384,7 +384,7 @@ %end-doc */ -static int Puller(int argc, char **argv, Coord Ux, Coord Uy) +static int Puller(int argc, const char **argv, Coord Ux, Coord Uy) { double arc_angle, base_angle; #if TRACE1 @@ -2265,7 +2265,7 @@ } #endif -static int GlobalPuller(int argc, char **argv, Coord x, Coord y) +static int GlobalPuller(int argc, const char **argv, Coord x, Coord y) { int select_flags = 0; Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 3142) +++ trunk/src_plugins/renumber/renumber.c (revision 3143) @@ -54,7 +54,7 @@ #define WTF 0 -static int ActionRenumber(int argc, char **argv, Coord x, Coord y) +static int ActionRenumber(int argc, const char **argv, Coord x, Coord y) { bool changed = false; ElementTypePtr *element_list; @@ -63,7 +63,7 @@ unsigned int tmpi; size_t sz; char *tmps; - char *name; + const char *name; FILE *out; static char *default_file = NULL; size_t cnt_list_sz = 100; @@ -104,7 +104,7 @@ fclose(out); if (!gui->confirm_dialog(_("File exists! Ok to overwrite?"), 0)) { if (free_name && name) - free(name); + free((char*)name); return 0; } } @@ -112,12 +112,12 @@ if ((out = fopen(name, "w")) == NULL) { Message(PCB_MSG_DEFAULT, _("Could not open %s\n"), name); if (free_name && name) - free(name); + free((char*)name); return 1; } if (free_name && name) - free(name); + free((char*)name); fprintf(out, "*COMMENT* PCB Annotation File\n"); fprintf(out, "*FILEVERSION* 20061031\n"); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 3142) +++ trunk/src_plugins/report/report.c (revision 3143) @@ -61,7 +61,7 @@ #define USER_UNITMASK (conf_core.editor.grid_unit->allow) -static int ReportDrills(int argc, char **argv, Coord x, Coord y) +static int ReportDrills(int argc, const char **argv, Coord x, Coord y) { DrillInfoTypePtr AllDrills; Cardinal n; @@ -118,7 +118,7 @@ %end-doc */ -static int ReportDialog(int argc, char **argv, Coord x, Coord y) +static int ReportDialog(int argc, const char **argv, Coord x, Coord y) { void *ptr1, *ptr2, *ptr3; int type; @@ -468,7 +468,7 @@ return 0; } -static int ReportFoundPins(int argc, char **argv, Coord x, Coord y) +static int ReportFoundPins(int argc, const char **argv, Coord x, Coord y) { gds_t list; int col = 0; @@ -542,7 +542,7 @@ return length; } -static int ReportAllNetLengths(int argc, char **argv, Coord x, Coord y) +static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y) { int ni; int found; @@ -624,7 +624,7 @@ return 0; } -static int ReportNetLength(int argc, char **argv, Coord x, Coord y) +static int ReportNetLength(int argc, const char **argv, Coord x, Coord y) { Coord length = 0; char *netname = 0; @@ -715,7 +715,7 @@ return 0; } -static int ReportNetLengthByName(char *tofind, int x, int y) +static int ReportNetLengthByName(const char *tofind, int x, int y) { char *netname = 0; Coord length = 0; @@ -862,7 +862,7 @@ %end-doc */ -static int Report(int argc, char **argv, Coord x, Coord y) +static int Report(int argc, const char **argv, Coord x, Coord y) { if ((argc < 1) || (argc > 2)) AUSAGE(report); Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 3142) +++ trunk/src_plugins/shand_cmd/command.c (revision 3143) @@ -76,7 +76,7 @@ %end-doc */ -static int CommandHelp(int argc, char **argv, Coord x, Coord y) +static int CommandHelp(int argc, const char **argv, Coord x, Coord y) { Message(PCB_MSG_DEFAULT, "following commands are supported:\n" " Command() execute an action command (too numerous to list)\n" @@ -110,9 +110,9 @@ %end-doc */ -static int CommandLoadLayout(int argc, char **argv, Coord x, Coord y) +static int CommandLoadLayout(int argc, const char **argv, Coord x, Coord y) { - char *filename, *format = NULL; + const char *filename, *format = NULL; switch (argc) { case 2: @@ -146,9 +146,9 @@ %end-doc */ -static int CommandLoadElementToBuffer(int argc, char **argv, Coord x, Coord y) +static int CommandLoadElementToBuffer(int argc, const char **argv, Coord x, Coord y) { - char *filename; + const char *filename; switch (argc) { case 1: /* filename is passed in commandline */ @@ -180,9 +180,9 @@ %end-doc */ -static int CommandLoadLayoutToBuffer(int argc, char **argv, Coord x, Coord y) +static int CommandLoadLayoutToBuffer(int argc, const char **argv, Coord x, Coord y) { - char *filename, *format = NULL; + const char *filename, *format = NULL; switch (argc) { case 2: @@ -215,7 +215,7 @@ %end-doc */ -static int CommandQuit(int argc, char **argv, Coord x, Coord y) +static int CommandQuit(int argc, const char **argv, Coord x, Coord y) { if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) QuitApplication(); @@ -235,7 +235,7 @@ %end-doc */ -static int CommandReallyQuit(int argc, char **argv, Coord x, Coord y) +static int CommandReallyQuit(int argc, const char **argv, Coord x, Coord y) { QuitApplication(); return 0; @@ -261,9 +261,9 @@ %end-doc */ -static int CommandLoadNetlist(int argc, char **argv, Coord x, Coord y) +static int CommandLoadNetlist(int argc, const char **argv, Coord x, Coord y) { - char *filename; + const char *filename; switch (argc) { case 1: /* filename is passed in commandline */ @@ -311,7 +311,7 @@ %end-doc */ -static int CommandSaveLayout(int argc, char **argv, Coord x, Coord y) +static int CommandSaveLayout(int argc, const char **argv, Coord x, Coord y) { switch (argc) { case 0: @@ -355,7 +355,7 @@ %end-doc */ -static int CommandSaveLayoutAndQuit(int argc, char **argv, Coord x, Coord y) +static int CommandSaveLayoutAndQuit(int argc, const char **argv, Coord x, Coord y) { if (!CommandSaveLayout(argc, argv, x, y)) return CommandQuit(0, 0, 0, 0); Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 3142) +++ trunk/src_plugins/vendordrill/vendor.c (revision 3143) @@ -101,7 +101,7 @@ sizes for your vendor. %end-doc */ -int ActionApplyVendor(int argc, char **argv, Coord x, Coord y) +int ActionApplyVendor(int argc, const char **argv, Coord x, Coord y) { hid_action("Busy"); apply_vendor_map(); @@ -122,7 +122,7 @@ %end-doc */ -int ActionUnloadVendor(int argc, char **argv, Coord x, Coord y) +int ActionUnloadVendor(int argc, const char **argv, Coord x, Coord y) { cached_drill = -1; @@ -150,9 +150,9 @@ %end-doc */ -int ActionLoadVendorFrom(int argc, char **argv, Coord x, Coord y) +int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y) { - char *fname = NULL; + const char *fname = NULL; static char *default_file = NULL; const char *sval; lht_doc_t *doc; @@ -161,7 +161,7 @@ cached_drill = -1; - fname = argc ? argv[0] : 0; + fname = argc ? argv[0] : NULL; if (!fname || !*fname) { fname = gui->fileselect(_("Load Vendor Resource File..."), @@ -290,7 +290,7 @@ apply_vendor_map(); if (free_fname) - free(fname); + free((char*)fname); lht_dom_uninit(doc); return 0; }