diff options
author | miwi <miwi@FreeBSD.org> | 2007-11-28 06:49:01 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2007-11-28 06:49:01 +0800 |
commit | 198c1e8503e360ae0fe8c75ad710b88e1e41b865 (patch) | |
tree | 74a5e82e73a57cc734908f083aa74dd0eb1d9bb8 | |
parent | fe538d52bdeceb2921f6e678dfe6f30a44980556 (diff) | |
download | freebsd-ports-gnome-198c1e8503e360ae0fe8c75ad710b88e1e41b865.tar.gz freebsd-ports-gnome-198c1e8503e360ae0fe8c75ad710b88e1e41b865.tar.zst freebsd-ports-gnome-198c1e8503e360ae0fe8c75ad710b88e1e41b865.zip |
- Fix build with GCC 4.2
- Remove most warnings
- Add OPTIONS Knob
- Pass maintainership to submitter
PR: 118246
Submitted by: Pietro Cerutti <gahr@gahr.ch>
Approved by: portmgr (pav)
24 files changed, 886 insertions, 9 deletions
diff --git a/cad/mars/Makefile b/cad/mars/Makefile index ac08c03a28f9..f8f08fa1b307 100644 --- a/cad/mars/Makefile +++ b/cad/mars/Makefile @@ -16,24 +16,31 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MaRS-2-doc${EXTRACT_SUFX} .endif EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= gahr@gahr.ch COMMENT= Maryland Routing Simulator +OPTIONS= X11 "Build with X11 support via Motif" on + +.include <bsd.port.pre.mk> + NO_WRKSUBDIR= yes -.if defined(WITHOUT_X11) -MAKEFILE= Makefile.NoX -.else +.if defined(WITH_X11) USE_MOTIF= yes MAKEFILE= Makefile.XMotif +.else +MAKEFILE= Makefile.NoX .endif ALL_TARGET= depend mars MAN1= mars.1 -.include <bsd.port.pre.mk> - -.if ${OSVERSION} >= 700042 -BROKEN= Broken with gcc 4.2 -.endif +post-configure: + @${REINPLACE_CMD} -e 's/INFINITY/MARS_INFINITY/g' \ + ${WRKSRC}/include/route.h \ + ${WRKSRC}/comps/exBF.c \ + ${WRKSRC}/comps/exBF_ack.c \ + ${WRKSRC}/comps/route.c \ + ${WRKSRC}/comps/segal.c \ + ${WRKSRC}/comps/spf.c do-install: ${INSTALL_PROGRAM} ${WRKSRC}/mars ${PREFIX}/bin diff --git a/cad/mars/files/patch-XMotif_edit.c b/cad/mars/files/patch-XMotif_edit.c new file mode 100644 index 000000000000..501f3eb9e703 --- /dev/null +++ b/cad/mars/files/patch-XMotif_edit.c @@ -0,0 +1,50 @@ +--- XMotif/edit.c.orig 2007-11-23 21:36:17.000000000 +0100 ++++ XMotif/edit.c 2007-11-23 21:40:19.000000000 +0100 +@@ -73,11 +73,11 @@ + void selection_confirm_kill_cb(Widget widget); + + MenuItem edit_items[] = { +- {"Create Component",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,edit_create_cb,(XtPointer)E_CREATE_COMPONENT,(MenuItem *)NULL,NULL}, +- {"",&xmSeparatorGadgetClass,NULL,NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, +- {"Kill Selection",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,selection_confirm_kill_cb,(XtPointer)E_REMOVE_SELECTION,(MenuItem *)NULL,NULL}, +- {"Group Selection",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,edit_group_cb,(XtPointer)E_GROUP_SELECTION,(MenuItem *)NULL,NULL}, +- {"Unselect All",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,edit_unsel_cb,(XtPointer)E_UNSELECT_ALL,(MenuItem *)NULL,NULL}, ++ {"Create Component",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,edit_create_cb,(XtPointer)E_CREATE_COMPONENT,(MenuItem *)NULL,NULL}, ++ {"",&xmSeparatorGadgetClass,'\0',NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, ++ {"Kill Selection",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,selection_confirm_kill_cb,(XtPointer)E_REMOVE_SELECTION,(MenuItem *)NULL,NULL}, ++ {"Group Selection",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,edit_group_cb,(XtPointer)E_GROUP_SELECTION,(MenuItem *)NULL,NULL}, ++ {"Unselect All",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,edit_unsel_cb,(XtPointer)E_UNSELECT_ALL,(MenuItem *)NULL,NULL}, + NULL + }; + +@@ -167,9 +167,9 @@ + if (l_empty(selected)) return; + if (!question_dialog) { + question_dialog=XmCreateQuestionDialog(main_w,"confirm_kill_selection_dialog",NULL,0); +- XtAddCallback(question_dialog,XmNokCallback,edit_remove_cb,NULL); +- XtAddCallback(question_dialog,XmNokCallback,XtUnmanageChild,NULL); +- XtAddCallback(question_dialog,XmNcancelCallback,XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)edit_remove_cb,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNcancelCallback,(XtCallbackProc)XtUnmanageChild,NULL); + } + else { + XRaiseWindow(XtDisplay(question_dialog),XtWindow(XtParent(question_dialog))); +@@ -233,7 +233,7 @@ + box_w=0; + box_h=0; + +- for(i=0;component_types[i].class!=NULL;i++) { ++ for(i=0;component_types[i].class!=0;i++) { + Widget icon; + + x=X_OFFSET+col*COL_SPACING; +@@ -265,7 +265,7 @@ + XmNtopWidget, icon_box, + NULL); + +- XtAddCallback(done_button,XmNactivateCallback,create_comp_done_cb,form); ++ XtAddCallback(done_button,XmNactivateCallback,(XtCallbackProc)create_comp_done_cb,form); + return(form); + } + diff --git a/cad/mars/files/patch-XMotif_info_w.c b/cad/mars/files/patch-XMotif_info_w.c new file mode 100644 index 000000000000..6f0f9607b435 --- /dev/null +++ b/cad/mars/files/patch-XMotif_info_w.c @@ -0,0 +1,94 @@ +--- XMotif/info_w.c.orig 2007-11-23 22:04:53.000000000 +0100 ++++ XMotif/info_w.c 2007-11-23 22:06:58.000000000 +0100 +@@ -374,7 +374,7 @@ + NULL); + + if (parameter->p_flags & (InputMask | ModifyMask)) +- XtAddCallback(textfield, XmNactivateCallback, change_parameter_cb, window_data); ++ XtAddCallback(textfield, XmNactivateCallback, (XtCallbackProc)change_parameter_cb, window_data); + else + XtVaSetValues(textfield, XmNeditable,False,NULL); + +@@ -413,7 +413,7 @@ + XmNbackground, bg, + XmNset, (window_data->initial_hide_settings & HIDE_CHILDREN)? True : False, + NULL); +- XtAddCallback(toggle, XmNvalueChangedCallback, comp_info_children_toggle_cb, window_data); ++ XtAddCallback(toggle, XmNvalueChangedCallback, (XtCallbackProc)comp_info_children_toggle_cb, window_data); + + + /* METER TOGGLE */ +@@ -421,7 +421,7 @@ + XmNbackground, bg, + XmNset, (window_data->initial_hide_settings & HIDE_METERS)? True : False, + NULL); +- XtAddCallback(toggle, XmNvalueChangedCallback, comp_info_meter_toggle_cb, window_data); ++ XtAddCallback(toggle, XmNvalueChangedCallback, (XtCallbackProc)comp_info_meter_toggle_cb, window_data); + + XtManageChild(row_col); + XtManageChild(form); +@@ -461,7 +461,7 @@ + Widget w; + CompInfoWinData *window_data; + { +- XtRemoveCallback(w,XmNokCallback, comp_info_kill_action, window_data); ++ XtRemoveCallback(w,XmNokCallback, (XtCallbackProc)comp_info_kill_action, window_data); + XtRemoveCallback(w,XmNokCallback, close_confirm_kill_comp_dialog, window_data); + XtRemoveCallback(w,XmNcancelCallback, close_confirm_kill_comp_dialog, window_data); + XtUnmanageChild(w); +@@ -481,15 +481,15 @@ + question_dialog=XmCreateQuestionDialog(main_w,"confirm_kill_component_dialog",NULL,0); + } + +- XtAddCallback(question_dialog,XmNokCallback, comp_info_kill_action, window_data); ++ XtAddCallback(question_dialog,XmNokCallback, (XtCallbackProc)comp_info_kill_action, window_data); + XtAddCallback(question_dialog,XmNokCallback, close_confirm_kill_comp_dialog, window_data); + XtAddCallback(question_dialog,XmNcancelCallback, close_confirm_kill_comp_dialog, window_data); + + pos.x=((XButtonEvent *)cbs->event)->x_root; + pos.y=((XButtonEvent *)cbs->event)->y_root; +- XtAddCallback(XtParent(question_dialog), XmNpopupCallback, SetShellPosition, &pos); ++ XtAddCallback(XtParent(question_dialog), XmNpopupCallback, (XtCallbackProc)SetShellPosition, &pos); + XtManageChild(question_dialog); +- XtRemoveCallback(XtParent(question_dialog), XmNpopupCallback, SetShellPosition, &pos); ++ XtRemoveCallback(XtParent(question_dialog), XmNpopupCallback, (XtCallbackProc)SetShellPosition, &pos); + } + + /**********************************************************************************************************************************************/ +@@ -803,7 +803,7 @@ + XmNleftAttachment, XmATTACH_FORM, + NULL); + +- XtAddCallback(textfield,XmNactivateCallback, change_group_name_cb, window_data); ++ XtAddCallback(textfield,XmNactivateCallback, (XtCallbackProc)change_group_name_cb, window_data); + } + + sep=CreateSeparator(group_info_w,XmSINGLE_LINE,name_input); +@@ -864,7 +864,7 @@ + Widget w; + CompInfoWinData *window_data; + { +- XtRemoveCallback(w,XmNokCallback, group_info_kill_action, window_data); ++ XtRemoveCallback(w,XmNokCallback, (XtCallbackProc)group_info_kill_action, window_data); + XtRemoveCallback(w,XmNokCallback, close_confirm_kill_group_dialog, window_data); + XtRemoveCallback(w,XmNcancelCallback, close_confirm_kill_group_dialog, window_data); + XtUnmanageChild(w); +@@ -882,15 +882,15 @@ + if (!question_dialog) { + question_dialog=XmCreateQuestionDialog(main_w,"confirm_kill_group_dialog",NULL,0); + } +- XtAddCallback(question_dialog, XmNokCallback, group_info_kill_action, window_data); ++ XtAddCallback(question_dialog, XmNokCallback, (XtCallbackProc)group_info_kill_action, window_data); + XtAddCallback(question_dialog, XmNokCallback, close_confirm_kill_group_dialog, window_data); + XtAddCallback(question_dialog, XmNcancelCallback, close_confirm_kill_group_dialog, window_data); + + pos.x=((XButtonEvent *)cbs->event)->x_root; + pos.y=((XButtonEvent *)cbs->event)->y_root; +- XtAddCallback(XtParent(question_dialog), XmNpopupCallback, SetShellPosition, &pos); ++ XtAddCallback(XtParent(question_dialog), XmNpopupCallback, (XtCallbackProc)SetShellPosition, &pos); + XtManageChild(question_dialog); +- XtRemoveCallback(XtParent(question_dialog), XmNpopupCallback, SetShellPosition, &pos); ++ XtRemoveCallback(XtParent(question_dialog), XmNpopupCallback, (XtCallbackProc)SetShellPosition, &pos); + } + + /**********************************************************************************************************************************************/ diff --git a/cad/mars/files/patch-XMotif_io.c b/cad/mars/files/patch-XMotif_io.c new file mode 100644 index 000000000000..f15fc4e50275 --- /dev/null +++ b/cad/mars/files/patch-XMotif_io.c @@ -0,0 +1,37 @@ +--- XMotif/io.c.orig 2007-11-23 21:31:17.000000000 +0100 ++++ XMotif/io.c 2007-11-23 21:33:26.000000000 +0100 +@@ -77,7 +77,7 @@ + void update_screen() + { + update_clock(); +- if (screen_update != NULL) { ++ if (screen_update != OFF) { + update_meters_and_info_windows(); + } + XFlush(the_environment.the_display); +@@ -240,9 +240,9 @@ + base_position=XmTextGetLastPosition(message_w); + XmTextSetInsertionPosition(message_w,base_position); + +- XtAddCallback(message_w,XmNactivateCallback, input_text, NULL); +- XtAddCallback(message_w,XmNmotionVerifyCallback, input_text, NULL); +- XtAddCallback(message_w,XmNmodifyVerifyCallback, input_text, NULL); ++ XtAddCallback(message_w,XmNactivateCallback, (XtCallbackProc)input_text, NULL); ++ XtAddCallback(message_w,XmNmotionVerifyCallback, (XtCallbackProc)input_text, NULL); ++ XtAddCallback(message_w,XmNmodifyVerifyCallback, (XtCallbackProc)input_text, NULL); + + input=0; + XmTextSetEditable(message_w,True); +@@ -251,9 +251,9 @@ + } + XmTextSetEditable(message_w,False); + +- XtRemoveCallback(message_w,XmNactivateCallback, input_text, NULL); +- XtRemoveCallback(message_w,XmNmotionVerifyCallback, input_text, NULL); +- XtRemoveCallback(message_w,XmNmodifyVerifyCallback, input_text, NULL); ++ XtRemoveCallback(message_w,XmNactivateCallback, (XtCallbackProc)input_text, NULL); ++ XtRemoveCallback(message_w,XmNmotionVerifyCallback, (XtCallbackProc)input_text, NULL); ++ XtRemoveCallback(message_w,XmNmodifyVerifyCallback, (XtCallbackProc)input_text, NULL); + + str=XmTextGetString(message_w); + diff --git a/cad/mars/files/patch-XMotif_lines.c b/cad/mars/files/patch-XMotif_lines.c new file mode 100644 index 000000000000..30f2839c3c59 --- /dev/null +++ b/cad/mars/files/patch-XMotif_lines.c @@ -0,0 +1,19 @@ +--- XMotif/lines.c.orig 1992-10-07 04:16:16.000000000 +0100 ++++ XMotif/lines.c 2007-11-23 22:16:24.000000000 +0100 +@@ -154,10 +154,13 @@ + int number_of_lines=sl->num_lines; + ComponentPair *comp_pairs=sl->comp_pairs; + register int i; ++ MComponent *tmp; + +- if (comp2<comp1) +- swap((caddr_t)comp1,(caddr_t)comp2); +- ++ if (comp2<comp1) { ++ tmp = comp2; ++ comp2 = comp1; ++ comp1 = tmp; ++ } + + for (i = 0; i < number_of_lines; ++i) { + if ((comp_pairs[i].comp1 == comp1) && diff --git a/cad/mars/files/patch-XMotif_main_w.c b/cad/mars/files/patch-XMotif_main_w.c new file mode 100644 index 000000000000..6eccfae959a0 --- /dev/null +++ b/cad/mars/files/patch-XMotif_main_w.c @@ -0,0 +1,31 @@ +--- XMotif/main_w.c.orig 2007-11-23 21:34:10.000000000 +0100 ++++ XMotif/main_w.c 2007-11-23 21:35:22.000000000 +0100 +@@ -217,7 +217,7 @@ + XmNbottomAttachment, XmATTACH_FORM, + NULL); + +- XtAddCallback(pause_button,XmNactivateCallback,pause_button_cb,NULL); ++ XtAddCallback(pause_button,XmNactivateCallback,(XtCallbackProc)pause_button_cb,NULL); + + start_button=XtVaCreateManagedWidget("start_button",xmPushButtonWidgetClass, header, + XmNleftAttachment, XmATTACH_WIDGET, +@@ -226,7 +226,7 @@ + XmNbottomAttachment, XmATTACH_FORM, + NULL); + +- XtAddCallback(start_button,XmNactivateCallback,start_button_cb,NULL); ++ XtAddCallback(start_button,XmNactivateCallback,(XtCallbackProc)start_button_cb,NULL); + + XtManageChild(header); + +@@ -270,8 +270,8 @@ + XmNbackground, the_environment.back_color, + NULL); + +- XtAddEventHandler(network_w, StructureNotifyMask, False, resize_network_w_event_handler, NULL); +- XtAddEventHandler(network_w, ExposureMask, False, redraw_lines_event_handler, NULL); ++ XtAddEventHandler(network_w, StructureNotifyMask, False, (XtEventHandler)resize_network_w_event_handler, NULL); ++ XtAddEventHandler(network_w, ExposureMask, False, (XtEventHandler)redraw_lines_event_handler, NULL); + + XtVaSetValues(scroll_w, + XmNworkWindow, network_w, diff --git a/cad/mars/files/patch-XMotif_meters.c b/cad/mars/files/patch-XMotif_meters.c new file mode 100644 index 000000000000..c8c208332dd8 --- /dev/null +++ b/cad/mars/files/patch-XMotif_meters.c @@ -0,0 +1,106 @@ +--- XMotif/meters.c.orig 2007-11-23 21:40:49.000000000 +0100 ++++ XMotif/meters.c 2007-11-23 21:45:10.000000000 +0100 +@@ -570,7 +570,7 @@ + buttons[n]=XmStringCreateSimple(meter_types[i].meter_name); + } + +- popup=XmVaCreateSimplePopupMenu(parent,"meter_type_popup_menu",change_meter_type, ++ popup=XmVaCreateSimplePopupMenu(parent,"meter_type_popup_menu",(XtCallbackProc)change_meter_type, + XmVaPUSHBUTTON, buttons[0], 0, NULL, NULL, + XmVaPUSHBUTTON, buttons[1], 0, NULL, NULL, + XmVaPUSHBUTTON, buttons[2], 0, NULL, NULL, +@@ -594,7 +594,7 @@ + XmNbackground, bg, + NULL); + XmStringFree(str); +- XtAddCallback(item, XmNactivateCallback, popup_change_meter_type_menu, popup); ++ XtAddCallback(item, XmNactivateCallback, (XtCallbackProc)popup_change_meter_type_menu, popup); + } + *textfield_return=NULL; + break; +@@ -744,10 +744,10 @@ + data->previous_value=new_string(value); + data->new_value=NULL; + if (edit_flags & EDIT_ON_ACTIVATE) { +- XtAddCallback(textfield, XmNactivateCallback, preview_textfield, NULL); ++ XtAddCallback(textfield, XmNactivateCallback, (XtCallbackProc)preview_textfield, NULL); + XtAddCallback(textfield, XmNactivateCallback, edit_callback, edit_calldata); +- XtAddCallback(textfield, XmNactivateCallback, update_textfield, NULL); +- XtAddCallback(textfield, XmNdestroyCallback, free_TextFieldData, NULL); ++ XtAddCallback(textfield, XmNactivateCallback, (XtCallbackProc)update_textfield, NULL); ++ XtAddCallback(textfield, XmNdestroyCallback, (XtCallbackProc)free_TextFieldData, NULL); + } + } + else { +@@ -898,7 +898,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%lf", &scale) == NULL) { ++ if (!sscanf(data->new_value, "%lf", &scale)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -925,7 +925,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%lf", &increment) == NULL) { ++ if (!sscanf(data->new_value, "%lf", &increment)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -967,7 +967,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%f", &increment) == NULL) { ++ if (!sscanf(data->new_value, "%f", &increment)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -1004,7 +1004,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%f", &increment) == NULL) { ++ if (!sscanf(data->new_value, "%f", &increment)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -1041,7 +1041,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%f", &increment) == NULL) { ++ if (!sscanf(data->new_value, "%f", &increment)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -1078,7 +1078,7 @@ + + data=GetTextFieldData(w); + if (data->value_changed) { +- if (sscanf(data->new_value, "%f", &increment) == NULL) { ++ if (!sscanf(data->new_value, "%f", &increment)) { + data->action=RESTORE_PREVIOUS_VALUE; + return; + } +@@ -1439,7 +1439,7 @@ + NULL); + + XtOverrideTranslations(draw_area, the_environment.meter_window_translations); +- XtAddEventHandler(draw_area, ExposureMask, False, meter_expose_event_handler, meter); ++ XtAddEventHandler(draw_area, ExposureMask, False, (XtEventHandler)meter_expose_event_handler, meter); + + XtVaSetValues(form, XmNwidth, (Dimension)meter->width, NULL); + +@@ -2143,7 +2143,7 @@ + if (xinput(answer_string, 20) == 0) + { + xprintclear(); /* user just typed return */ +- return (NULL); ++ return (0); + } + xprintclear(); + diff --git a/cad/mars/files/patch-XMotif_mfile.c b/cad/mars/files/patch-XMotif_mfile.c new file mode 100644 index 000000000000..8d6d53e2648c --- /dev/null +++ b/cad/mars/files/patch-XMotif_mfile.c @@ -0,0 +1,95 @@ +--- XMotif/mfile.c.orig 1994-03-15 05:43:09.000000000 +0100 ++++ XMotif/mfile.c 2007-11-23 21:59:35.000000000 +0100 +@@ -80,17 +80,17 @@ + #define F_QUIT 8 + + MenuItem file_items[] = { +- {"",&xmSeparatorGadgetClass,NULL,NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, +- {"New",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,confirm_clear_network,(XtPointer)F_NEW,(MenuItem *)NULL,NULL}, +- {"Open",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_OPEN,(MenuItem *)NULL,NULL}, +- {"Save",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_SAVE,(MenuItem *)NULL,NULL}, +- {"Snap",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_SNAP,(MenuItem *)NULL,NULL}, +- {"Print",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_PRINT,(MenuItem *)NULL,NULL}, +- {"",&xmSeparatorGadgetClass,NULL,NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, +- {"Stop Record",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,record,(XtPointer)F_RECORD,(MenuItem *)NULL,initialize_record_button}, +- {"Play",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_PLAY,(MenuItem *)NULL,NULL}, +- {"",&xmSeparatorGadgetClass,NULL,NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, +- {"Quit",&xmPushButtonGadgetClass,NULL,NULL,NULL,XmNactivateCallback,confirm_quit,(XtPointer)F_QUIT,(MenuItem *)NULL,NULL}, ++ {"",&xmSeparatorGadgetClass,'\0',NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, ++ {"New",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,confirm_clear_network,(XtPointer)F_NEW,(MenuItem *)NULL,NULL}, ++ {"Open",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_OPEN,(MenuItem *)NULL,NULL}, ++ {"Save",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_SAVE,(MenuItem *)NULL,NULL}, ++ {"Snap",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_SNAP,(MenuItem *)NULL,NULL}, ++ {"Print",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_PRINT,(MenuItem *)NULL,NULL}, ++ {"",&xmSeparatorGadgetClass,'\0',NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, ++ {"Stop Record",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,record,(XtPointer)F_RECORD,(MenuItem *)NULL,initialize_record_button}, ++ {"Play",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,file_cb,(XtPointer)F_PLAY,(MenuItem *)NULL,NULL}, ++ {"",&xmSeparatorGadgetClass,'\0',NULL,NULL,NULL,NULL,NULL,(MenuItem *)NULL,NULL}, ++ {"Quit",&xmPushButtonGadgetClass,'\0',NULL,NULL,XmNactivateCallback,confirm_quit,(XtPointer)F_QUIT,(MenuItem *)NULL,NULL}, + NULL + }; + +@@ -858,9 +858,9 @@ + + if (!question_dialog) { + question_dialog=XmCreateQuestionDialog(main_w_shell,"confirm_clear_network_dialog",NULL,0); +- XtAddCallback(question_dialog,XmNokCallback,file_new_cb,NULL); +- XtAddCallback(question_dialog,XmNokCallback,XtUnmanageChild,NULL); +- XtAddCallback(question_dialog,XmNcancelCallback,XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)file_new_cb,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNcancelCallback,(XtCallbackProc)XtUnmanageChild,NULL); + } + XtManageChild(question_dialog); + XRaiseWindow(the_environment.the_display, XtWindow(XtParent(question_dialog))); +@@ -896,9 +896,9 @@ + } + if (!question_dialog) { + question_dialog=XmCreateQuestionDialog(main_w_shell,"confirm_quit_dialog",NULL,0); +- XtAddCallback(question_dialog,XmNokCallback,file_quit_cb,NULL); +- XtAddCallback(question_dialog,XmNokCallback,XtUnmanageChild,NULL); +- XtAddCallback(question_dialog,XmNcancelCallback,XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)file_quit_cb,NULL); ++ XtAddCallback(question_dialog,XmNokCallback,(XtCallbackProc)XtUnmanageChild,NULL); ++ XtAddCallback(question_dialog,XmNcancelCallback,(XtCallbackProc)XtUnmanageChild,NULL); + } + XtManageChild(question_dialog); + XRaiseWindow(the_environment.the_display, XtWindow(XtParent(question_dialog))); +@@ -936,7 +936,7 @@ + XmNtopAttachment, XmATTACH_WIDGET, + XmNtopWidget, sep, + NULL); +- XtAddCallback(fs_box, XmNcancelCallback, cancel_file_selection, NULL); ++ XtAddCallback(fs_box, XmNcancelCallback, (XtCallbackProc)cancel_file_selection, NULL); + XtManageChild(fs_box); + } + else { +@@ -945,23 +945,23 @@ + + switch(item) { + case F_OPEN: +- XtAddCallback(fs_box, XmNokCallback, load_network, NULL); ++ XtAddCallback(fs_box, XmNokCallback, (XtCallbackProc)load_network, NULL); + SetLabelString(label, "Open Network"); + break; + case F_SAVE: +- XtAddCallback(fs_box, XmNokCallback, save_network, FALSE); ++ XtAddCallback(fs_box, XmNokCallback, (XtCallbackProc)save_network, FALSE); + SetLabelString(label, "Save Network"); + break; + case F_SNAP: +- XtAddCallback(fs_box, XmNokCallback, save_network, TRUE); ++ XtAddCallback(fs_box, XmNokCallback, (XtCallbackProc)save_network, (XtPointer) TRUE); + SetLabelString(label, "Save Snapshot"); + break; + case F_PRINT: +- XtAddCallback(fs_box, XmNokCallback, print, NULL); ++ XtAddCallback(fs_box, XmNokCallback, (XtCallbackProc)print, NULL); + SetLabelString(label, "Print Network"); + break; + case F_PLAY: +- XtAddCallback(fs_box, XmNokCallback, play, NULL); ++ XtAddCallback(fs_box, XmNokCallback, (XtCallbackProc)play, NULL); + SetLabelString(label, "Playback Events"); + break; + default: WARNING("Unexpected item no. in file_cb.\n"); break; diff --git a/cad/mars/files/patch-XMotif_options.c b/cad/mars/files/patch-XMotif_options.c new file mode 100644 index 000000000000..ff2b4e952589 --- /dev/null +++ b/cad/mars/files/patch-XMotif_options.c @@ -0,0 +1,54 @@ +--- XMotif/options.c.orig 2007-11-23 22:02:50.000000000 +0100 ++++ XMotif/options.c 2007-11-23 22:04:08.000000000 +0100 +@@ -70,17 +70,17 @@ + Widget delay_button; + + MenuItem opmodes_radiobox[] = { +- {"Continuous", &xmToggleButtonGadgetClass, NULL, NULL, NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)CONTINUOUS_BUTTON, (MenuItem*)NULL, initialize_continuous_button}, +- {"Event Step", &xmToggleButtonGadgetClass, NULL, NULL ,NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)EVENT_STEP_BUTTON, (MenuItem*)NULL, initialize_event_step_button}, +- {"Time Step", &xmToggleButtonGadgetClass, NULL, NULL, NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)TIME_STEP_BUTTON, (MenuItem*)NULL, initialize_time_step_button}, ++ {"Continuous", &xmToggleButtonGadgetClass, '\0', NULL, NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)CONTINUOUS_BUTTON, (MenuItem*)NULL, initialize_continuous_button}, ++ {"Event Step", &xmToggleButtonGadgetClass, '\0', NULL ,NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)EVENT_STEP_BUTTON, (MenuItem*)NULL, initialize_event_step_button}, ++ {"Time Step", &xmToggleButtonGadgetClass, '\0', NULL, NULL, XmNvalueChangedCallback, opmodes_cb, (XtPointer)TIME_STEP_BUTTON, (MenuItem*)NULL, initialize_time_step_button}, + NULL + }; + + MenuItem options_items[] = { +- {"Delay", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, delay_cb, (XtPointer)O_DELAY, (MenuItem *)NULL, initialize_delay_button}, +- {"", &xmSeparatorGadgetClass, NULL, NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL, NULL}, +- {"Operating Mode", &xmCascadeButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, NULL, (XtPointer)O_OPERATING_MODE,opmodes_radiobox, NULL}, +- {"Resize Network", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, resize_dialog_cb, (XtPointer)O_RESIZE, (MenuItem *)NULL, NULL}, ++ {"Delay", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, delay_cb, (XtPointer)O_DELAY, (MenuItem *)NULL, initialize_delay_button}, ++ {"", &xmSeparatorGadgetClass, '\0', NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL, NULL}, ++ {"Operating Mode", &xmCascadeButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, NULL, (XtPointer)O_OPERATING_MODE,opmodes_radiobox, NULL}, ++ {"Resize Network", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, resize_dialog_cb, (XtPointer)O_RESIZE, (MenuItem *)NULL, NULL}, + NULL + }; + +@@ -241,7 +241,7 @@ + /* Width Textfield */ + sprintf(buf,"%d",the_environment.network_width); + width_input=CreateTextInput(resize_dialog,"width",buf,&textfields[0]); +- XtAddCallback(textfields[0],XmNactivateCallback,resize_check_input,&resize_max_w); ++ XtAddCallback(textfields[0],XmNactivateCallback,(XtCallbackProc)resize_check_input,&resize_max_w); + XtVaSetValues(width_input, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, +@@ -252,7 +252,7 @@ + /* Height Textfield */ + sprintf(buf,"%d",the_environment.network_height); + height_input=CreateTextInput(resize_dialog,"height",buf,&textfields[1]); +- XtAddCallback(textfields[1],XmNactivateCallback,resize_check_input,&resize_max_h); ++ XtAddCallback(textfields[1],XmNactivateCallback,(XtCallbackProc)resize_check_input,&resize_max_h); + XtVaSetValues(height_input, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, +@@ -262,7 +262,7 @@ + + /* Minimize Button */ + minimize_button=XtVaCreateManagedWidget("minimize_button", xmPushButtonWidgetClass, resize_dialog, NULL); +- XtAddCallback(minimize_button, XmNactivateCallback, resize_minimize, textfields); ++ XtAddCallback(minimize_button, XmNactivateCallback, (XtCallbackProc)resize_minimize, textfields); + XtVaSetValues(minimize_button, + XmNleftAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, diff --git a/cad/mars/files/patch-XMotif_param_w.c b/cad/mars/files/patch-XMotif_param_w.c new file mode 100644 index 000000000000..2ce8e84a0f26 --- /dev/null +++ b/cad/mars/files/patch-XMotif_param_w.c @@ -0,0 +1,31 @@ +--- XMotif/param_w.c.orig 1992-10-07 04:16:18.000000000 +0100 ++++ XMotif/param_w.c 2007-11-23 22:12:20.000000000 +0100 +@@ -444,7 +444,7 @@ + XmNrightAttachment, XmATTACH_POSITION, + XmNset, (parameter->p_flags & LogMask)? True : False, + NULL); +- XtAddCallback(log_toggle, XmNvalueChangedCallback, comp_param_log_toggle, window_data); ++ XtAddCallback(log_toggle, XmNvalueChangedCallback, (XtCallbackProc)comp_param_log_toggle, window_data); + SetWidgetUserData(log_toggle,p_textf); + p_textf->log_toggle=log_toggle; + } +@@ -459,7 +459,7 @@ + XmNrightAttachment, XmATTACH_POSITION, + XmNset, (parameter->p_flags & MeterMask)? True : False, + NULL); +- XtAddCallback(meter_toggle, XmNvalueChangedCallback, comp_param_meter_toggle, window_data); ++ XtAddCallback(meter_toggle, XmNvalueChangedCallback, (XtCallbackProc)comp_param_meter_toggle, window_data); + SetWidgetUserData(meter_toggle,p_textf); + p_textf->meter_toggle=meter_toggle; + } +@@ -479,8 +479,8 @@ + NULL); + + if (parameter->p_flags & (InputMask | ModifyMask) && i!=0) { /* The name parameter is not editable from this window. */ +- XtAddCallback(p_textf->textfield,XmNvalueChangedCallback,set_changed_by_user_flag,window_data); +- XtAddCallback(p_textf->textfield,XmNactivateCallback,change_parameter_cb,window_data); ++ XtAddCallback(p_textf->textfield,XmNvalueChangedCallback,(XtCallbackProc)set_changed_by_user_flag,window_data); ++ XtAddCallback(p_textf->textfield,XmNactivateCallback,(XtCallbackProc)change_parameter_cb,window_data); + p_textf->initial_value=new_string(value); + p_textf->current_value=new_string(value); + } diff --git a/cad/mars/files/patch-XMotif_view.c b/cad/mars/files/patch-XMotif_view.c new file mode 100644 index 000000000000..e0b53d5fd879 --- /dev/null +++ b/cad/mars/files/patch-XMotif_view.c @@ -0,0 +1,50 @@ +--- XMotif/view.c.orig 2007-11-23 22:00:21.000000000 +0100 ++++ XMotif/view.c 2007-11-23 22:02:13.000000000 +0100 +@@ -75,13 +75,13 @@ + void close_all_groups(Widget w); + + MenuItem view_items[] = { +- {"Update Screen", &xmToggleButtonGadgetClass, NULL, NULL, NULL, XmNvalueChangedCallback, toggle_update_screen, (XtPointer)NULL, (MenuItem *)NULL,initialize_update_screen_toggle}, +- {"",&xmSeparatorGadgetClass, NULL, NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL,NULL}, +- {"Open Meter Window", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, view_meter_cb, (XtPointer)V_METER_WINDOW, (MenuItem *)NULL, NULL}, +- {"Close All Information Windows", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, close_all_info_w, (XtPointer)V_CLOSE_ALL_INFO_WINDOWS, (MenuItem *)NULL, NULL}, +- {"Close All Groups", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, close_all_groups, (XtPointer)V_CLOSE_ALL_GROUPS, (MenuItem *)NULL, NULL}, +- {"",&xmSeparatorGadgetClass, NULL, NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL,NULL}, +- {"Hide", &xmPushButtonGadgetClass, NULL, NULL, NULL, XmNactivateCallback, view_hide_cb, (XtPointer)V_HIDE, (MenuItem *)NULL,NULL}, ++ {"Update Screen", &xmToggleButtonGadgetClass, '\0', NULL, NULL, XmNvalueChangedCallback, toggle_update_screen, (XtPointer)NULL, (MenuItem *)NULL,initialize_update_screen_toggle}, ++ {"",&xmSeparatorGadgetClass, '\0', NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL,NULL}, ++ {"Open Meter Window", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, view_meter_cb, (XtPointer)V_METER_WINDOW, (MenuItem *)NULL, NULL}, ++ {"Close All Information Windows", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, close_all_info_w, (XtPointer)V_CLOSE_ALL_INFO_WINDOWS, (MenuItem *)NULL, NULL}, ++ {"Close All Groups", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, close_all_groups, (XtPointer)V_CLOSE_ALL_GROUPS, (MenuItem *)NULL, NULL}, ++ {"",&xmSeparatorGadgetClass, '\0', NULL, NULL, NULL, NULL, NULL, (MenuItem *)NULL,NULL}, ++ {"Hide", &xmPushButtonGadgetClass, '\0', NULL, NULL, XmNactivateCallback, view_hide_cb, (XtPointer)V_HIDE, (MenuItem *)NULL,NULL}, + NULL + }; + +@@ -284,7 +284,7 @@ + XmNrightAttachment, XmATTACH_FORM, + NULL); + +- for(num_components=0;component_types[num_components].class!=NULL;num_components++); ++ for(num_components=0;component_types[num_components].class!=0;num_components++); + hide_components_toggles=(Widget *)sim_malloc(sizeof(Widget)*num_components); + + for(i=0;i<num_components;i++) { +@@ -297,7 +297,7 @@ + XmNset, (the_environment.hide_settings>>i & 0x1L)? True:False, + NULL); + XmStringFree(str); +- XtAddCallback(hide_components_toggles[i], XmNvalueChangedCallback, hide_w_component_toggle_cb, (XtPointer)i); ++ XtAddCallback(hide_components_toggles[i], XmNvalueChangedCallback, (XtCallbackProc)hide_w_component_toggle_cb, (XtPointer)i); + } + str=XmStringCreateSimple("METERS"); + hide_meters_toggle=XtVaCreateManagedWidget("toggle_button", xmToggleButtonGadgetClass,row_col, +@@ -308,7 +308,7 @@ + XmNset, (the_environment.hide_meters)? True:False, + NULL); + XmStringFree(str); +- XtAddCallback(hide_meters_toggle, XmNvalueChangedCallback, hide_w_component_toggle_cb, (XtPointer)TYPE_METER); ++ XtAddCallback(hide_meters_toggle, XmNvalueChangedCallback, (XtCallbackProc)hide_w_component_toggle_cb, (XtPointer)TYPE_METER); + + XtManageChild(row_col); + diff --git a/cad/mars/files/patch-XMotif_xinit.c b/cad/mars/files/patch-XMotif_xinit.c new file mode 100644 index 000000000000..1537c918b7bf --- /dev/null +++ b/cad/mars/files/patch-XMotif_xinit.c @@ -0,0 +1,61 @@ +--- XMotif/xinit.c.orig 2007-11-23 21:08:13.000000000 +0100 ++++ XMotif/xinit.c 2007-11-23 21:29:50.000000000 +0100 +@@ -83,32 +83,32 @@ + + + XtActionsRec actions[]={ +- {"move_component",move_component}, +- {"lower_component",lower_component}, +- {"raise_component",raise_component}, +- {"join_components",join_components}, +- {"select_component",select_component}, +- {"open_group",open_group}, +- {"close_group",close_group}, +- {"drag_component_icon",create_comp_drag_icon}, +- {"open_parameter_window",open_param_w_tn}, +- {"close_parameter_window",close_param_w_tn}, +- {"open_close_parameter_window",open_close_param_w_tn}, +- {"open_information_window",open_info_w_tn}, +- {"open_close_information_window",open_close_info_w_tn}, +- {"close_information_window",close_info_w_tn}, +- {"move_window",move_window}, +- {"raise_window",raise_window}, +- {"lower_window",lower_window}, +- {"rubberbox",rubberbox}, +- {"make_peers",make_peer}, +- {"open_meter_information_window",open_meter_info_w_tn}, +- {"close_meter_information_window",close_meter_info_w_tn}, +- {"open_close_meter_information_window",open_close_meter_info_w_tn}, +- {"move_meter",move_meter}, +- {"raise_meter",raise_meter}, +- {"lower_meter",lower_meter}, +- {"resize_meter",resize_meter} ++ {(String)"move_component",(XtActionProc)move_component}, ++ {(String)"lower_component",(XtActionProc)lower_component}, ++ {(String)"raise_component",(XtActionProc)raise_component}, ++ {(String)"join_components",(XtActionProc)join_components}, ++ {(String)"select_component",(XtActionProc)select_component}, ++ {(String)"open_group",(XtActionProc)open_group}, ++ {(String)"close_group",(XtActionProc)close_group}, ++ {(String)"drag_component_icon",(XtActionProc)create_comp_drag_icon}, ++ {(String)"open_parameter_window",(XtActionProc)open_param_w_tn}, ++ {(String)"close_parameter_window",(XtActionProc)close_param_w_tn}, ++ {(String)"open_close_parameter_window",(XtActionProc)open_close_param_w_tn}, ++ {(String)"open_information_window",(XtActionProc)open_info_w_tn}, ++ {(String)"open_close_information_window",(XtActionProc)open_close_info_w_tn}, ++ {(String)"close_information_window",(XtActionProc)close_info_w_tn}, ++ {(String)"move_window",(XtActionProc)move_window}, ++ {(String)"raise_window",(XtActionProc)raise_window}, ++ {(String)"lower_window",(XtActionProc)lower_window}, ++ {(String)"rubberbox",(XtActionProc)rubberbox}, ++ {(String)"make_peers",(XtActionProc)make_peer}, ++ {(String)"open_meter_information_window",(XtActionProc)open_meter_info_w_tn}, ++ {(String)"close_meter_information_window",(XtActionProc)close_meter_info_w_tn}, ++ {(String)"open_close_meter_information_window",(XtActionProc)open_close_meter_info_w_tn}, ++ {(String)"move_meter",(XtActionProc)move_meter}, ++ {(String)"raise_meter",(XtActionProc)raise_meter}, ++ {(String)"lower_meter",(XtActionProc)lower_meter}, ++ {(String)"resize_meter",(XtActionProc)resize_meter} + }; + + int screen_update; diff --git a/cad/mars/files/patch-comps_ftp.c b/cad/mars/files/patch-comps_ftp.c new file mode 100644 index 000000000000..7278763c2e10 --- /dev/null +++ b/cad/mars/files/patch-comps_ftp.c @@ -0,0 +1,47 @@ +--- comps/ftp.c.orig 2007-11-23 23:37:24.000000000 +0100 ++++ comps/ftp.c 2007-11-23 23:41:03.000000000 +0100 +@@ -554,7 +554,7 @@ + /* Schedule next computation */ + ev_enqueue(EV_INSTANT_RATE, (Component *)g, (Component *)g, + ev_now() + perf_update_dt_usecs / USECS_PER_TICK, +- g->ftp_action, (caddr_t *)NULL, (caddr_t)NULL); ++ g->ftp_action, (Packet *)NULL, (caddr_t)NULL); + return ((caddr_t)g); + } + +@@ -584,7 +584,7 @@ + /* Schedule first computation of instantaneous thruput */ + ev_enqueue(EV_INSTANT_RATE, (Component *)g, (Component *)g, + ev_now() + perf_update_dt_usecs/USECS_PER_TICK, +- g->ftp_action, (caddr_t *)NULL, (caddr_t)NULL); ++ g->ftp_action, (Packet *)NULL, (caddr_t)NULL); + + /* produce first packet */ + if (strcmp(g->init_conn_on_off->u.p, "On") == 0) +@@ -593,7 +593,7 @@ + time = ticks_btw_conns(g); + + ev_enqueue(EV_APTR_CONN_ON, (Component *)g, (Component *)g, +- time, g->ftp_action, (caddr_t *)NULL, train_length(g)); ++ time, g->ftp_action, (Packet *)NULL, (caddr_t)train_length(g)); + + /* send a token packet */ + pkt = pk_alloc(); +@@ -707,7 +707,7 @@ + /* schedule an event for the next pkt */ + ev_enqueue(EV_APTR_PRODUCE, (Component *)g, (Component *)g, + ev_now() + ticks_btw_packets(g), +- g->ftp_action, (caddr_t *)NULL, (caddr_t)NULL); ++ (PFP)g->ftp_action, (Packet *)NULL, (caddr_t)NULL); + else { + g->produce_scheduled = 0; + /* schedule an event for the next connection i.e. train */ +@@ -715,7 +715,7 @@ + g->ftp_tr_how_many->u.i == -1) + ev_enqueue(EV_APTR_CONN_ON, (Component *)g, (Component *)g, + ev_now() + ticks_btw_conns(g), +- g->ftp_action, (Packet *)NULL, train_length(g)); ++ g->ftp_action, (Packet *)NULL, (caddr_t) train_length(g)); + } + + return((caddr_t)g); diff --git a/cad/mars/files/patch-comps_node.c b/cad/mars/files/patch-comps_node.c new file mode 100644 index 000000000000..8a485691d121 --- /dev/null +++ b/cad/mars/files/patch-comps_node.c @@ -0,0 +1,29 @@ +--- comps/node.c.orig 2007-11-23 23:35:05.000000000 +0100 ++++ comps/node.c 2007-11-23 23:36:22.000000000 +0100 +@@ -644,7 +644,7 @@ + nd->nd_delay->u.i/USECS_PER_TICK + ticks; + ev_enqueue(EV_NODE_SEND, (Component *)nd, (Component *)nd, + pkt->pk_time , nd->nd_action, (Packet *)NULL, +- (Neighbor *)n); ++ (caddr_t)n); + } + + +@@ -759,7 +759,7 @@ + pkt->pk_time = ev_now() + process_delay + ticks; + ev_enqueue(EV_NODE_SEND, (Component *)nd, (Component *)nd, + pkt->pk_time , nd->nd_action, (Packet *)NULL, +- (Neighbor *)n); ++ (caddr_t)n); + q_addt(n->n_pq, (caddr_t)pkt); + log_param((Component *)nd, n->n_p); + } +@@ -804,7 +804,7 @@ + if (n->n_pq->q_len > 0) { + time_value = ((Packet *)(n->n_pq->q_head->qe_data))->pk_time; + ev_enqueue(EV_NODE_SEND, (Component *)nd, (Component *)nd, +- time_value, nd->nd_action, (Packet *)NULL, (Neighbor *)n); ++ time_value, nd->nd_action, (Packet *)NULL, (caddr_t)n); + } + return((caddr_t)nd); + } diff --git a/cad/mars/files/patch-comps_telnet.c b/cad/mars/files/patch-comps_telnet.c new file mode 100644 index 000000000000..7b753f7927bf --- /dev/null +++ b/cad/mars/files/patch-comps_telnet.c @@ -0,0 +1,20 @@ +--- comps/telnet.c.orig 2007-11-23 23:41:45.000000000 +0100 ++++ comps/telnet.c 2007-11-23 23:42:14.000000000 +0100 +@@ -619,7 +619,7 @@ + time = ticks_btw_conns(g); + + ev_enqueue(EV_APTR_CONN_ON, (Component *)g, (Component *)g, +- time, g->telnet_action, (Packet *)NULL, train_length(g)); ++ time, g->telnet_action, (Packet *)NULL, (caddr_t)train_length(g)); + + /* send a token packet */ + pkt = pk_alloc(); +@@ -760,7 +760,7 @@ + g->telnet_tr_how_many->u.i == -1) + ev_enqueue(EV_APTR_CONN_ON, (Component *)g, (Component *)g, + ev_now() + ticks_btw_conns(g), +- g->telnet_action, (Packet *)NULL, train_length(g)); ++ g->telnet_action, (Packet *)NULL, (caddr_t)train_length(g)); + } + + return((caddr_t)g); diff --git a/cad/mars/files/patch-include_lcostfcn.h b/cad/mars/files/patch-include_lcostfcn.h new file mode 100644 index 000000000000..f261c9b6b1dd --- /dev/null +++ b/cad/mars/files/patch-include_lcostfcn.h @@ -0,0 +1,9 @@ +--- include/lcostfcn.h.orig 2007-11-23 23:19:41.000000000 +0100 ++++ include/lcostfcn.h 2007-11-23 23:19:51.000000000 +0100 +@@ -64,5 +64,5 @@ + + extern Lcostfcn *lcostfcn_adr; + +-#endif LCOSTFCN_H ++#endif /* !LCOSTFCN_H */ + diff --git a/cad/mars/files/patch-include_perf.h b/cad/mars/files/patch-include_perf.h new file mode 100644 index 000000000000..555f77ecd503 --- /dev/null +++ b/cad/mars/files/patch-include_perf.h @@ -0,0 +1,9 @@ +--- include/perf.h.orig 2007-11-23 23:18:53.000000000 +0100 ++++ include/perf.h 2007-11-23 23:19:18.000000000 +0100 +@@ -181,5 +181,5 @@ + + } Pmt; + +-#endif PERF_MON_H ++#endif /* !PERF_MON_H */ + diff --git a/cad/mars/files/patch-include_sim.h b/cad/mars/files/patch-include_sim.h new file mode 100644 index 000000000000..a71b92b15616 --- /dev/null +++ b/cad/mars/files/patch-include_sim.h @@ -0,0 +1,27 @@ +--- include/sim.h.orig 1992-10-07 04:51:27.000000000 +0100 ++++ include/sim.h 2007-11-23 23:51:50.000000000 +0100 +@@ -4,7 +4,9 @@ + + #include <sys/types.h> + #include <strings.h> ++#include <string.h> + #include <stdio.h> ++#include <stdlib.h> + #include <math.h> + + /* Things for all simulator routines */ +@@ -83,14 +85,11 @@ + #define CONST + #endif /* __STDC__ */ + +-extern char *strncpy(), *strcpy(), *strcat(), *strncat(); +-extern char *calloc(), *malloc(), *realloc(); + char *sim_calloc(), *sim_malloc(), *sim_realloc(); + void panic(); + + /** Largest number returned by random(). (2**31)-1 From RANDOM(3) */ + #define MAX_RANDOM_NUMBER 2147483647 +-extern long random(); + double random_range(); + + #define min(a, b) ((a) < (b) ? (a) : (b)) diff --git a/cad/mars/files/patch-include_stopper.h b/cad/mars/files/patch-include_stopper.h new file mode 100644 index 000000000000..616ff8b5c34f --- /dev/null +++ b/cad/mars/files/patch-include_stopper.h @@ -0,0 +1,9 @@ +--- include/stopper.h.orig 2007-11-23 23:20:44.000000000 +0100 ++++ include/stopper.h 2007-11-23 23:20:55.000000000 +0100 +@@ -69,5 +69,5 @@ + + } Stopper; + +-#endif STOPPER_H ++#endif /* !STOPPER_H */ + diff --git a/cad/mars/files/patch-sim_compfiles.c b/cad/mars/files/patch-sim_compfiles.c new file mode 100644 index 000000000000..e1aecd796bb8 --- /dev/null +++ b/cad/mars/files/patch-sim_compfiles.c @@ -0,0 +1,9 @@ +--- sim/comptypes.c.orig 2007-11-23 23:17:42.000000000 +0100 ++++ sim/comptypes.c 2007-11-23 23:18:07.000000000 +0100 +@@ -96,5 +96,5 @@ + stopper_p}, + {"LINK_COST_FUNC", AUXILIARY_CLASS,lcostfcn_action, + link_cost_func_p}, +- {"", NULL} /* This line indicates the end of the list. */ ++ {"", 0} /* This line indicates the end of the list. */ + }; diff --git a/cad/mars/files/patch-sim_event.c b/cad/mars/files/patch-sim_event.c new file mode 100644 index 000000000000..7b74f752b8c5 --- /dev/null +++ b/cad/mars/files/patch-sim_event.c @@ -0,0 +1,33 @@ +--- sim/event.c.orig 2007-11-23 21:54:37.000000000 +0100 ++++ sim/event.c 2007-11-23 21:55:23.000000000 +0100 +@@ -433,14 +433,13 @@ + I'm just using the stack to store a list of events that must be + deleted, rather than creating my own list/array/whatever. + */ +- ++static void ev_dequeue_by_comp_and_type1(); + void + ev_dequeue_by_comp_and_type(src, dest, type) + + Component *src, *dest; + Evtype type; + { +- static void ev_dequeue_by_comp_and_type1(); + ev_dequeue_by_comp_and_type1(src, dest, type, + (Event *)heap_iter_init(event_queue)); + } +@@ -476,13 +475,11 @@ + I'm just using the stack to store a list of events that must be + deleted, rather than creating my own list/array/whatever. + */ +- ++static void ev_dequeue_by_time1(); + void + ev_dequeue_by_time(t) + tick_t t; + { +- static void ev_dequeue_by_time1(); +- + ev_dequeue_by_time1(t, (Event *)heap_iter_init(event_queue)); + } + diff --git a/cad/mars/files/patch-sim_file.c b/cad/mars/files/patch-sim_file.c new file mode 100644 index 000000000000..1c01066cca5c --- /dev/null +++ b/cad/mars/files/patch-sim_file.c @@ -0,0 +1,11 @@ +--- sim/file.c.orig 2007-11-23 23:15:16.000000000 +0100 ++++ sim/file.c 2007-11-23 23:16:18.000000000 +0100 +@@ -252,7 +252,7 @@ + + #ifndef NoX + if (doXstuff) { +- if (((COMP_OBJECT) c1->co_picture = (COMP_OBJECT)pop_comp_window((COMPONENT *)c1,xpos, ypos)) == (COMP_OBJECT) NULL) { ++ if (( c1->co_picture = (COMP_OBJECT)pop_comp_window((COMPONENT *)c1,xpos, ypos)) == NULL) { + + #ifdef DEBUG + dbg_write(debug_log, DBG_ERR, (Component *)NULL, diff --git a/cad/mars/files/patch-sim_mempool.c b/cad/mars/files/patch-sim_mempool.c new file mode 100644 index 000000000000..c330e7191bfe --- /dev/null +++ b/cad/mars/files/patch-sim_mempool.c @@ -0,0 +1,10 @@ +--- sim/mempool.c.orig 2007-11-23 22:23:58.000000000 +0100 ++++ sim/mempool.c 2007-11-23 22:24:10.000000000 +0100 +@@ -23,7 +23,6 @@ + #include "mempool.h" + + extern char *sim_calloc(), *sim_malloc(); +-#define NULL 0 + #define TRUE 1 + #define FALSE 0 + diff --git a/cad/mars/files/patch-sim_q.c b/cad/mars/files/patch-sim_q.c new file mode 100644 index 000000000000..21440e05f0a3 --- /dev/null +++ b/cad/mars/files/patch-sim_q.c @@ -0,0 +1,29 @@ +--- sim/q.c.orig 1992-10-07 04:52:52.000000000 +0100 ++++ sim/q.c 2007-11-23 22:23:21.000000000 +0100 +@@ -23,8 +23,6 @@ + + extern char *sim_calloc(), *sim_malloc(); + +-#define NULL 0 +- + /* If using GCC, this function is declared inline in q.h. */ + #ifndef INLINE + q_elt * +@@ -95,7 +93,7 @@ + return TRUE; + } + +- return NULL; /* not in queue, fail */ ++ return 0; /* not in queue, fail */ + } + + q_del(q, elt) +@@ -120,7 +118,7 @@ + return TRUE; + } + +- return NULL; /* not in queue, fail */ ++ return 0; /* not in queue, fail */ + } + + |