From 94c62e36eea53a51b94e978a99ce8d7b33620c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Gr=C3=A4f?= <aggraef@gmail.com> Date: Sun, 30 Aug 2020 16:57:00 +0200 Subject: [PATCH] mingw64 fixes: correct 64 bit int types and casts, switch to portable ANSI formats. --- externals/Makefile | 2 +- externals/OSCx/libOSC/OSC-timetag.c | 6 +- externals/OSCx/libOSC/test_OSC.c | 2 +- externals/OSCx/libOSC/test_OSC_timeTag.c | 8 +- externals/OSCx/send+dump/sendOSC.c | 2 +- externals/bbogart/entry/entry.c | 30 +-- externals/bbogart/popup/popup.c | 72 +++---- externals/ggee/gui/button.c | 50 ++--- externals/ggee/gui/envgen.c | 2 +- externals/ggee/gui/image.c | 8 +- externals/hcs/canvas_name.c | 2 +- externals/hcs/colorpanel.c | 2 +- externals/hcs/cursor.c | 2 +- externals/hcs/screensize.c | 2 +- externals/hcs/sys_gui.c | 2 +- externals/hcs/window_name.c | 2 +- externals/iem/iemguts/src/receivecanvas.c | 2 +- externals/miXed/cyclone/hammer/active.c | 2 +- externals/miXed/cyclone/hammer/comment.c | 12 +- externals/miXed/cyclone/hammer/pv.c | 6 +- externals/moonlib/image.c | 48 ++--- externals/mrpeach/net/udpreceive.c | 2 +- externals/mrpeach/net/udpreceive~.c | 4 +- externals/mrpeach/net/udpsend.c | 2 +- externals/mrpeach/net/udpsend~.c | 2 +- externals/tof/src/folderpanel.c | 2 +- externals/tof/src/imagebang.c | 20 +- externals/tof/test/imagebutton.c | 2 +- externals/unauthorized/cooled~.c | 2 +- externals/unauthorized/pianoroll.c | 2 +- pd/src/d_ugen.c | 22 +- pd/src/g_all_guis.c | 38 ++-- pd/src/g_all_guis.h | 6 +- pd/src/g_array.c | 18 +- pd/src/g_bang.c | 4 +- pd/src/g_canvas.c | 58 ++--- pd/src/g_editor.c | 153 +++++++------ pd/src/g_graph.c | 42 ++-- pd/src/g_io.c | 14 +- pd/src/g_magicglass.c | 6 +- pd/src/g_numbox.c | 12 +- pd/src/g_radio.c | 2 +- pd/src/g_rtext.c | 34 +-- pd/src/g_scalar.c | 66 +++--- pd/src/g_slider.c | 2 +- pd/src/g_template.c | 252 +++++++++++----------- pd/src/g_text.c | 16 +- pd/src/m_memory.c | 6 +- pd/src/m_pd.c | 12 +- pd/src/m_pd.h | 6 +- pd/src/makefile.mingw | 2 +- pd/src/s_audio_alsamm.c | 4 +- pd/src/s_file.c | 4 +- pd/src/s_inter.c | 20 +- pd/src/s_main.c | 6 +- pd/src/s_print.c | 6 +- pd/src/x_gui.c | 10 +- pd/src/x_interface.c | 2 +- pd/src/x_preset.c | 24 +-- pd/src/x_text.c | 22 +- pd/src/x_vexp.c | 12 +- 61 files changed, 593 insertions(+), 590 deletions(-) diff --git a/externals/Makefile b/externals/Makefile index 9f55395a6..4aa265918 100644 --- a/externals/Makefile +++ b/externals/Makefile @@ -48,7 +48,7 @@ DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \ BUILDSRC_OS_NAME = $(OS_NAME) WARN_FLAGS = -Wall -W -Wno-unused-parameter -CFLAGS = -DPD -I$(pd_src)/src $(WARN_FLAGS) $(DEBUG_CFLAGS) $(CFLAGS_ADD) -I$(gem_src)/src +CFLAGS = -DPD -D__USE_MINGW_ANSI_STDIO=1 -I$(pd_src)/src $(WARN_FLAGS) $(DEBUG_CFLAGS) $(CFLAGS_ADD) -I$(gem_src)/src LDFLAGS = LIBS = -lm diff --git a/externals/OSCx/libOSC/OSC-timetag.c b/externals/OSCx/libOSC/OSC-timetag.c index 666daef0c..6a2f51909 100644 --- a/externals/OSCx/libOSC/OSC-timetag.c +++ b/externals/OSCx/libOSC/OSC-timetag.c @@ -50,7 +50,7 @@ OSCTimeTag OSCTT_BiggestPossibleTimeTag(void) { OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { int8 offset = (int8) (secondsOffset * TWO_TO_THE_32_FLOAT); -/* printf("* OSCTT_PlusSeconds %llx plus %f seconds (i.e., %lld offset) is %llx\n", original, +/* printf("* OSCTT_PlusSeconds %zx plus %f seconds (i.e., %lld offset) is %zx\n", original, secondsOffset, offset, original + offset); */ return original + offset; @@ -58,7 +58,7 @@ OSCTimeTag OSCTT_PlusSeconds(OSCTimeTag original, float secondsOffset) { int OSCTT_Compare(OSCTimeTag left, OSCTimeTag right) { #if 0 - printf("***** OSCTT_Compare(%llx, %llx): %d\n", left, right, + printf("***** OSCTT_Compare(%zx, %zx): %d\n", left, right, (left<right) ? -1 : ((left == right) ? 0 : 1)); #endif if (left < right) { @@ -107,7 +107,7 @@ OSCTimeTag OSCTT_CurrentTime(void) { result += usecOffset; -/* printf("* OSCTT_CurrentTime is %llx\n", result); */ +/* printf("* OSCTT_CurrentTime is %zx\n", result); */ return result; } diff --git a/externals/OSCx/libOSC/test_OSC.c b/externals/OSCx/libOSC/test_OSC.c index 4593ec672..bf1111df2 100644 --- a/externals/OSCx/libOSC/test_OSC.c +++ b/externals/OSCx/libOSC/test_OSC.c @@ -108,7 +108,7 @@ main() { printf("Testing time tags\n"); tt = OSCTT_CurrentTime(); - printf("Time now is %llx\n", tt); + printf("Time now is %zx\n", tt); printf("Testing bundles\n"); if (OSC_openBundle(b, tt)) { diff --git a/externals/OSCx/libOSC/test_OSC_timeTag.c b/externals/OSCx/libOSC/test_OSC_timeTag.c index 8a1cabf80..373106f24 100644 --- a/externals/OSCx/libOSC/test_OSC_timeTag.c +++ b/externals/OSCx/libOSC/test_OSC_timeTag.c @@ -22,15 +22,15 @@ main() { OSCTimeTag now, later; now = OSCTT_CurrentTime(); - printf("Now it's %llu (0x%llx)\n", now, now); + printf("Now it's %llu (0x%zx)\n", now, now); - printf("Immediately would be %llu (0x%llx)\n", OSCTT_Immediately(), + printf("Immediately would be %llu (0x%zx)\n", OSCTT_Immediately(), OSCTT_Immediately()); later = OSCTT_PlusSeconds(now, 1.0f); - printf("One second from now would be %llu (0x%llx)\n", later, later); + printf("One second from now would be %llu (0x%zx)\n", later, later); now = OSCTT_CurrentTime(); - printf("And *now* it's %llu (0x%llx)\n", now, now); + printf("And *now* it's %llu (0x%zx)\n", now, now); } diff --git a/externals/OSCx/send+dump/sendOSC.c b/externals/OSCx/send+dump/sendOSC.c index bde4f8d00..b77c9ccc6 100644 --- a/externals/OSCx/send+dump/sendOSC.c +++ b/externals/OSCx/send+dump/sendOSC.c @@ -302,7 +302,7 @@ OSCTimeTag ParseTimeTag(char *s) { if (isdigit(*p) || (*p >= 'a' && *p <='f') || (*p >= 'A' && *p <='F')) { /* They specified the 8-byte tag in hex */ OSCTimeTag tt; - if (sscanf(p, "%llx", &tt) != 1) { + if (sscanf(p, "%zx", &tt) != 1) { complain("warning: couldn't parse time tag %s\n", s); return OSCTT_Immediately(); } diff --git a/externals/bbogart/entry/entry.c b/externals/bbogart/entry/entry.c index 50adfbcad..99fe1bce0 100644 --- a/externals/bbogart/entry/entry.c +++ b/externals/bbogart/entry/entry.c @@ -133,32 +133,32 @@ static void set_tk_widget_ids(t_entry *x, t_canvas *canvas) x->x_canvas = canvas; /* Tk ID for the current canvas that this object is drawn in */ - sprintf(buf,".x%lx.c", (long unsigned int) canvas); + sprintf(buf,".x%zx.c", (t_int) canvas); x->canvas_id = getbytes(strlen(buf) + 1); strcpy(x->canvas_id, buf); /* Tk ID for the "frame" the other things are drawn in */ - sprintf(buf,"%s.frame%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.frame%zx", x->canvas_id, (t_int)x); x->frame_id = getbytes(strlen(buf) + 1); strcpy(x->frame_id, buf); - sprintf(buf,"%s.text%lx", x->frame_id, (long unsigned int)x); + sprintf(buf,"%s.text%zx", x->frame_id, (t_int)x); x->text_id = getbytes(strlen(buf) + 1); strcpy(x->text_id, buf); /* Tk ID for the "text", the meat! */ - sprintf(buf,"%s.window%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.window%zx", x->canvas_id, (t_int)x); x->window_tag = getbytes(strlen(buf) + 1); strcpy(x->window_tag, buf); /* Tk ID for the resizing "window" */ - sprintf(buf,"%s.handle%lx", x->canvas_id, (long unsigned int)x); + sprintf(buf,"%s.handle%zx", x->canvas_id, (t_int)x); x->handle_id = getbytes(strlen(buf) + 1); strcpy(x->handle_id, buf); /* Tk ID for the resizing "handle" */ - sprintf(buf,"%s.scrollbar%lx", x->frame_id, (long unsigned int)x); + sprintf(buf,"%s.scrollbar%zx", x->frame_id, (t_int)x); x->scrollbar_id = getbytes(strlen(buf) + 1); strcpy(x->scrollbar_id, buf); /* Tk ID for the optional "scrollbar" */ - sprintf(buf,"all%lx", (long unsigned int)x); + sprintf(buf,"all%zx", (t_int)x); x->all_tag = getbytes(strlen(buf) + 1); strcpy(x->all_tag, buf); /* Tk ID for the optional "scrollbar" */ } @@ -273,7 +273,7 @@ static void create_widget(t_entry *x) DEBUG(post("create_widget");); /* I guess this is for fine-tuning of the rect size based on width and height? */ - sys_vgui("namespace eval entry%lx {} \n", x); + sys_vgui("namespace eval entry%zx {} \n", x); /* Seems we have to delete the widget in case it already exists (Provided by Guenter)*/ sys_vgui("destroy %s\n", x->frame_id); @@ -298,7 +298,7 @@ static void create_widget(t_entry *x) static void entry_drawme(t_entry *x, t_glist *glist, int firsttime) { - DEBUG(post("entry_drawme: firsttime %d canvas %lx glist %lx", firsttime, x->x_canvas, glist);); + DEBUG(post("entry_drawme: firsttime %d canvas %zx glist %zx", firsttime, x->x_canvas, glist);); set_tk_widget_ids(x,glist_getcanvas(glist)); if (firsttime) { @@ -321,7 +321,7 @@ static void entry_drawme(t_entry *x, t_glist *glist, int firsttime) static void entry_erase(t_entry* x,t_glist* glist) { - DEBUG(post("entry_erase: canvas %lx glist %lx", x->x_canvas, glist);); + DEBUG(post("entry_erase: canvas %zx glist %zx", x->x_canvas, glist);); set_tk_widget_ids(x,glist_getcanvas(glist)); erase_inlets(x); @@ -348,7 +348,7 @@ static void entry_getrect(t_gobj *z, t_glist *owner, static void entry_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_entry *x = (t_entry *)z; - DEBUG(post("entry_displace: canvas %lx glist %lx", x->x_canvas, glist);); + DEBUG(post("entry_displace: canvas %zx glist %zx", x->x_canvas, glist);); x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) @@ -369,7 +369,7 @@ static void entry_displace(t_gobj *z, t_glist *glist, int dx, int dy) static void entry_select(t_gobj *z, t_glist *glist, int state) { t_entry *x = (t_entry *)z; - DEBUG(post("entry_select: canvas %lx glist %lx state %d", x->x_canvas, glist, state);); + DEBUG(post("entry_select: canvas %zx glist %zx state %d", x->x_canvas, glist, state);); if( (state) && (!x->x_selected)) { @@ -422,7 +422,7 @@ static void entry_activate(t_gobj *z, t_glist *glist, int state) static void entry_delete(t_gobj *z, t_glist *glist) { - DEBUG(post("entry_delete: glist %lx", glist);); + DEBUG(post("entry_delete: glist %zx", glist);); t_text *x = (t_text *)z; canvas_deletelinesfor(glist, x); } @@ -431,7 +431,7 @@ static void entry_delete(t_gobj *z, t_glist *glist) static void entry_vis(t_gobj *z, t_glist *glist, int vis) { t_entry *x = (t_entry*)z; - DEBUG(post("entry_vis: vis %d canvas %lx glist %lx", vis, x->x_canvas, glist);); + DEBUG(post("entry_vis: vis %d canvas %zx glist %zx", vis, x->x_canvas, glist);); if (vis) { entry_drawme(x, glist, 1); } @@ -760,7 +760,7 @@ static void *entry_new(t_symbol *s, int argc, t_atom *argv) x->x_data_outlet = outlet_new(&x->x_obj, &s_float); x->x_status_outlet = outlet_new(&x->x_obj, &s_symbol); - sprintf(buf,"entry%lx",(long unsigned int)x); + sprintf(buf,"entry%zx",(t_int)x); x->tcl_namespace = getbytes(strlen(buf) + 1); strcpy(x->tcl_namespace, buf); diff --git a/externals/bbogart/popup/popup.c b/externals/bbogart/popup/popup.c index 1ea98a37d..58b3b2a1d 100644 --- a/externals/bbogart/popup/popup.c +++ b/externals/bbogart/popup/popup.c @@ -76,13 +76,13 @@ static void draw_inlets(t_popup *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxo%d %lxo}\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags {%zxo%d %zxo}\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxo%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxo%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1); @@ -94,13 +94,13 @@ static void draw_inlets(t_popup *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags {%lxi%d %lxi}\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags {%zxi%d %zxi}\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist)-2, onset + IOWIDTH, text_ypix(&x->x_obj, glist)-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxi%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxi%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)-1); @@ -116,14 +116,14 @@ static void draw_handle(t_popup *x, t_glist *glist, int firsttime) { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH); if (firsttime) { - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxhandle\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags %zxhandle\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4, x); } else { - sys_vgui(".x%lx.c coords %lxhandle %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxhandle %d %d %d %d\n", glist_getcanvas(glist), x, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4); @@ -155,19 +155,19 @@ static void create_widget(t_popup *x, t_glist *glist) /* Seems we have to delete the widget in case it already exists (Provided by Guenter)*/ if(x->initialized) { - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui("set %lxw .x%lx.c.s%lx ; menubutton $%lxw -relief raised -background \"%s\" -text \"%s\" -direction flush -menu $%lxw.menu ; menu $%lxw.menu -tearoff 0\n", + sys_vgui("set %zxw .x%zx.c.s%zx ; menubutton $%zxw -relief raised -background \"%s\" -text \"%s\" -direction flush -menu $%zxw.menu ; menu $%zxw.menu -tearoff 0\n", x,canvas,x,x,x->x_colour->s_name,temp_name->s_name,x,x); for(i=0 ; i<x->x_num_options ; i++) { - sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", canvas, x, x->x_options[i]->s_name, canvas, x, x->x_options[i]->s_name, x, i); } } - DEBUG(post("id: .x%lx.c.s%lx", canvas, x);) + DEBUG(post("id: .x%zx.c.s%zx", canvas, x);) DEBUG(post("create_widget end");) } @@ -181,21 +181,21 @@ static void popup_drawme(t_popup *x, t_glist *glist, int firsttime) DEBUG(post("drawme %d",firsttime);) if (firsttime) { - DEBUG(post("glist %lx canvas %lx",x->x_glist,canvas);) + DEBUG(post("glist %zx canvas %zx",x->x_glist,canvas);) create_widget(x,glist); x->x_glist = canvas; - sys_vgui(".x%lx.c create window %d %d -width %d -height %d -anchor nw -window .x%lx.c.s%lx -tags %lxS\n", + sys_vgui(".x%zx.c create window %d %d -width %d -height %d -anchor nw -window .x%zx.c.s%zx -tags %zxS\n", canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), x->x_width, x->x_height, x->x_glist,x,x); } else { - sys_vgui(".x%lx.c coords %lxS %d %d\n", + sys_vgui(".x%zx.c coords %zxS %d %d\n", canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); } draw_inlets(x, glist, firsttime, 2,2); // draw_handle(x, glist, firsttime); - sys_vgui(".x%lx.c.s%lx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); + sys_vgui(".x%zx.c.s%zx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); // Output a bang to first outlet when we're ready to receive float messages the first time!. @@ -212,15 +212,15 @@ static void popup_erase(t_popup* x,t_glist* glist) DEBUG(post("erase start");) if(x->initialized){ - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui(".x%lx.c delete %lxS\n",glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete %zxS\n",glist_getcanvas(glist), x); /* inlets and outlets */ - sys_vgui(".x%lx.c delete %lxi\n",glist_getcanvas(glist),x); /* Added tag for all inlets of one instance */ - sys_vgui(".x%lx.c delete %lxo\n",glist_getcanvas(glist),x); /* Added tag for all outlets of one instance */ - sys_vgui(".x%lx.c delete %lxhandle\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxi\n",glist_getcanvas(glist),x); /* Added tag for all inlets of one instance */ + sys_vgui(".x%zx.c delete %zxo\n",glist_getcanvas(glist),x); /* Added tag for all outlets of one instance */ + sys_vgui(".x%zx.c delete %zxhandle\n",glist_getcanvas(glist),x,0); } DEBUG(post("erase end");) @@ -258,7 +258,7 @@ static void popup_displace(t_gobj *z, t_glist *glist, x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) { - if(x->initialized)sys_vgui(".x%lx.c coords %lxSEL %d %d %d %d\n", + if(x->initialized)sys_vgui(".x%zx.c coords %zxSEL %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2); @@ -276,15 +276,15 @@ static void popup_select(t_gobj *z, t_glist *glist, int state) t_popup *x = (t_popup *)z; if(x->initialized){ if (state) { - sys_vgui(".x%lx.c create rectangle \ -%d %d %d %d -tags %lxSEL -outline blue\n", + sys_vgui(".x%zx.c create rectangle \ +%d %d %d %d -tags %zxSEL -outline blue\n", glist_getcanvas(glist), text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, x); } else { - sys_vgui(".x%lx.c delete %lxSEL\n", + sys_vgui(".x%zx.c delete %zxSEL\n", glist_getcanvas(glist), x); } } @@ -389,7 +389,7 @@ static void popup_options(t_popup* x, t_symbol *s, int argc, t_atom *argv) x->x_num_options = argc; /* delete old menu items */ - if(visible)sys_vgui(".x%lx.c.s%lx.menu delete 0 end \n", x->x_glist, x); + if(visible)sys_vgui(".x%zx.c.s%zx.menu delete 0 end \n", x->x_glist, x); if(argc>x->x_maxoptions){ /* resize the options-array */ @@ -401,7 +401,7 @@ static void popup_options(t_popup* x, t_symbol *s, int argc, t_atom *argv) for(i=0 ; i<argc ; i++) { x->x_options[i] = atom_getsymbol(argv+i); - if(visible)sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + if(visible)sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i); } @@ -415,7 +415,7 @@ static void popup_bgcolour(t_popup* x, t_symbol* col) DEBUG(post("bgcolour start");) x->x_colour = col; - if(visible)sys_vgui(".x%lx.c.s%lx configure -background \"%s\"\n", x->x_glist, x, col->s_name); + if(visible)sys_vgui(".x%zx.c.s%zx configure -background \"%s\"\n", x->x_glist, x, col->s_name); } /* Function to change name of popup */ @@ -425,7 +425,7 @@ static void popup_name(t_popup* x, t_symbol *name) DEBUG(post("name start");) x->x_name = name; - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", x->x_glist, x, name->s_name); + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", x->x_glist, x, name->s_name); } /* Function to select a menu option by inlet */ @@ -437,7 +437,7 @@ static void popup_iselect(t_popup* x, t_floatarg item) int i=(int)item; if( i<x->x_num_options && i>=0) { - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\" \n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\" \n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i); else popup_output(x, i); @@ -459,7 +459,7 @@ static void popup_symselect(t_popup* x, t_symbol *s) { if(x->x_options[i]->s_name == s->s_name) { - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\" \n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\" \n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i); else popup_output(x, i); match = 1; @@ -485,7 +485,7 @@ static void popup_set(t_popup* x, t_symbol *S, int argc, t_atom*argv) { x->current_selection = i; if(visible) - sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", + sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name); } else { error("popup: Valid menu selections are from %d to %d\npopup: You entered %d.", 0, x->x_num_options-1, i); @@ -500,7 +500,7 @@ static void popup_set(t_popup* x, t_symbol *S, int argc, t_atom*argv) if(x->x_options[i]->s_name == s->s_name) { x->current_selection = i; - if(visible)sys_vgui(".x%lx.c.s%lx configure -text \"%s\"\n", + if(visible)sys_vgui(".x%zx.c.s%zx configure -text \"%s\"\n", glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name); return; } @@ -541,7 +541,7 @@ static void popup_append(t_popup* x, t_symbol *s, int argc, t_atom *argv) for(i=x->x_num_options ; i<new_limit ; i++) { x->x_options[i] = atom_getsymbol(argv+i-x->x_num_options); - if(visible)sys_vgui(".x%lx.c.s%lx.menu add command -label \"%s\" -command {.x%lx.c.s%lx configure -text \"%s\" ; popup_sel%lx \"%d\"} \n", + if(visible)sys_vgui(".x%zx.c.s%zx.menu add command -label \"%s\" -command {.x%zx.c.s%zx configure -text \"%s\" ; popup_sel%zx \"%d\"} \n", x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i); } @@ -554,7 +554,7 @@ static void popup_disable(t_popup*x, t_float f){ x->x_disabled=(f>0.f); if(x->x_glist && glist_isvisible(x->x_glist)){ t_canvas *canvas=glist_getcanvas(x->x_glist); - sys_vgui(".x%lx.c.s%lx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); + sys_vgui(".x%zx.c.s%zx configure -state \"%s\"\n", canvas, x, x->x_disabled?"disabled":"active"); } } @@ -620,13 +620,13 @@ static void *popup_new(t_symbol *s, int argc, t_atom *argv) break; } - /* Bind the recieve "popup%lx" to the widget outlet*/ - sprintf(buf,"popup%lx", (long unsigned int)x); + /* Bind the recieve "popup%zx" to the widget outlet*/ + sprintf(buf,"popup%zx", (t_int)x); x->x_sym = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_sym); /* define proc in tcl/tk where "popup%p" is the receive, "output" is the method, and "$index" is an argument. */ - sys_vgui("proc popup_sel%lx {index} {\n pd [concat %s output $index \\;]\n }\n", + sys_vgui("proc popup_sel%zx {index} {\n pd [concat %s output $index \\;]\n }\n", x, buf); /* Add symbol inlet (hard to say how this actually works?? */ diff --git a/externals/ggee/gui/button.c b/externals/ggee/gui/button.c index 883e89f48..ff4ca42f0 100644 --- a/externals/ggee/gui/button.c +++ b/externals/ggee/gui/button.c @@ -44,13 +44,13 @@ static void draw_inlets(t_button *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxo%d %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxo%d %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1, x, i, x); else - sys_vgui(".x%lx.c coords %lxo%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxo%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 2, onset + IOWIDTH, text_ypix(&x->x_obj, glist) + x->x_rect_height-1); @@ -61,13 +61,13 @@ static void draw_inlets(t_button *x, t_glist *glist, int firsttime, int nin, int { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH) * i / nplus; if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxi%d %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxi%d %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)+5, x, i, x); else - sys_vgui(".x%lx.c coords %lxi%d %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxi%d %d %d %d %d\n", glist_getcanvas(glist), x, i, onset, text_ypix(&x->x_obj, glist), onset + IOWIDTH, text_ypix(&x->x_obj, glist)+5); @@ -81,13 +81,13 @@ static void draw_handle(t_button *x, t_glist *glist, int firsttime) { int onset = text_xpix(&x->x_obj, glist) + (x->x_rect_width - IOWIDTH+2); if (firsttime) - sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags { %lxhandle %lxS }\n", + sys_vgui(".x%zx.c create rectangle %d %d %d %d -tags { %zxhandle %zxS }\n", glist_getcanvas(glist), onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4, x, x); else - sys_vgui(".x%lx.c coords %lxhandle %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxhandle %d %d %d %d\n", glist_getcanvas(glist), x, onset, text_ypix(&x->x_obj, glist) + x->x_rect_height - 12, onset + IOWIDTH-2, text_ypix(&x->x_obj, glist) + x->x_rect_height-4); @@ -107,8 +107,8 @@ static void create_widget(t_button *x, t_glist *glist) if (text[i] == '_') text[i] = ' '; } - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); - sys_vgui("button .x%lx.c.s%lx -height %d -text \"%s\" -command button_cb%lx\n",canvas,x, + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); + sys_vgui("button .x%zx.c.s%zx -height %d -text \"%s\" -command button_cb%zx\n",canvas,x, x->x_height,text, x); } @@ -122,17 +122,17 @@ static void button_drawme(t_button *x, t_glist *glist, int firsttime) t_canvas *canvas=glist_getcanvas(glist); DEBUG(post("drawme %d",firsttime);) if (firsttime) { - DEBUG(post("glist %lx canvas %lx",x->x_glist,canvas);) + DEBUG(post("glist %zx canvas %zx",x->x_glist,canvas);) // if (x->x_glist != canvas) { create_widget(x,glist); x->x_glist = canvas; // } - sys_vgui(".x%lx.c create window %d %d -anchor nw -window .x%lx.c.s%lx -tags %lxS\n", + sys_vgui(".x%zx.c create window %d %d -anchor nw -window .x%zx.c.s%zx -tags %zxS\n", canvas,text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x->x_glist,x,x); } else { - sys_vgui(".x%lx.c coords %lxS \ + sys_vgui(".x%zx.c coords %zxS \ %d %d\n", canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); @@ -148,15 +148,15 @@ static void button_erase(t_button* x,t_glist* glist) int n; DEBUG(post("erase");) - sys_vgui("destroy .x%lx.c.s%lx\n",glist_getcanvas(glist),x); + sys_vgui("destroy .x%zx.c.s%zx\n",glist_getcanvas(glist),x); - sys_vgui(".x%lx.c delete %lxS\n",glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete %zxS\n",glist_getcanvas(glist), x); /* inlets and outlets */ - sys_vgui(".x%lx.c delete %lxi%d\n",glist_getcanvas(glist),x,0); - sys_vgui(".x%lx.c delete %lxo%d\n",glist_getcanvas(glist),x,0); - sys_vgui(".x%lx.c delete %lxhandle\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxi%d\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxo%d\n",glist_getcanvas(glist),x,0); + sys_vgui(".x%zx.c delete %zxhandle\n",glist_getcanvas(glist),x,0); } @@ -187,7 +187,7 @@ static void button_displace(t_gobj *z, t_glist *glist, x->x_obj.te_ypix += dy; if (glist_isvisible(glist)) { - sys_vgui(".x%lx.c coords %lxSEL %d %d %d %d\n", + sys_vgui(".x%zx.c coords %zxSEL %d %d %d %d\n", glist_getcanvas(glist), x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2); @@ -202,18 +202,18 @@ static void button_select(t_gobj *z, t_glist *glist, int state) { t_button *x = (t_button *)z; if (state) { - sys_vgui(".x%lx.c create rectangle \ -%d %d %d %d -tags { %lxSEL %lxS } -outline $select_color\n", + sys_vgui(".x%zx.c create rectangle \ +%d %d %d %d -tags { %zxSEL %zxS } -outline $select_color\n", glist_getcanvas(glist), text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)-1, text_xpix(&x->x_obj, glist) + x->x_rect_width, text_ypix(&x->x_obj, glist) + x->x_rect_height-2, x, x); - sys_vgui(".x%x.c addtag selected withtag %lxS\n", glist_getcanvas(glist), x); + sys_vgui(".x%x.c addtag selected withtag %zxS\n", glist_getcanvas(glist), x); } else { - sys_vgui(".x%lx.c delete %lxSEL\n", + sys_vgui(".x%zx.c delete %zxSEL\n", glist_getcanvas(glist), x); - sys_vgui(".x%lx.c dtag %lxS selected\n", glist_getcanvas(glist), x); + sys_vgui(".x%zx.c dtag %zxS selected\n", glist_getcanvas(glist), x); } @@ -268,7 +268,7 @@ void button_color(t_button* x,t_symbol* col) static void button_bang(t_button* x) { - sys_vgui(".x%lx.c.s%lx flash\n",x->x_glist,x); + sys_vgui(".x%zx.c.s%zx flash\n",x->x_glist,x); outlet_bang(x->x_obj.ob_outlet); } @@ -313,13 +313,13 @@ static void *button_new(t_symbol* text) /* TODO .. ask the button for its width */ x->x_width += strlen(x->x_text->s_name)*5.2; - sprintf(buf,"button%lx", (long unsigned int)x); + sprintf(buf,"button%zx", (t_int)x); x->x_sym = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_sym); /* pipe startup code to tk */ - sys_vgui("proc button_cb%lx {} {pd [concat %s b \\;]}\n", x, buf); + sys_vgui("proc button_cb%zx {} {pd [concat %s b \\;]}\n", x, buf); outlet_new(&x->x_obj, &s_float); return (x); diff --git a/externals/ggee/gui/envgen.c b/externals/ggee/gui/envgen.c index ab95281ae..6412d4b90 100644 --- a/externals/ggee/gui/envgen.c +++ b/externals/ggee/gui/envgen.c @@ -259,7 +259,7 @@ static void *envgen_new(t_symbol *s,int argc,t_atom* argv) x->args = STATES; x->finalvalues = getbytes( x->args*sizeof(t_float)); x->duration = getbytes( x->args*sizeof(t_float)); - DEBUG(post("finalvalues %lx",x->finalvalues);); + DEBUG(post("finalvalues %zx",x->finalvalues);); /* widget */ diff --git a/externals/ggee/gui/image.c b/externals/ggee/gui/image.c index 1251d2756..7a760774c 100644 --- a/externals/ggee/gui/image.c +++ b/externals/ggee/gui/image.c @@ -97,7 +97,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firstime) x, x, "center"); - //sys_vgui("catch {.x%lx.c delete %xS}\n", glist_getcanvas(glist), x); + //sys_vgui("catch {.x%zx.c delete %xS}\n", glist_getcanvas(glist), x); //sys_vgui(".x%x.c create image %d %d -tags %xS\n", // glist_getcanvas(glist),text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), x); @@ -268,8 +268,8 @@ static void image_select(t_gobj *z, t_glist *glist, int state) //sys_vgui("catch {.x%x.c delete %xSEL}\n", //glist_getcanvas(glist), x); //if (glist->gl_owner && !glist_istoplevel(glist)) - //sys_vgui(".x%lx.c dtag %xS selected\n", glist_getcanvas(glist), x); - //sys_vgui(".x%lx.c dtag %xMT selected\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c dtag %xS selected\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c dtag %xMT selected\n", glist_getcanvas(glist), x); gui_vmess("gui_image_toggle_border", "xxi", glist_getcanvas(glist), x, 0); gui_vmess("gui_gobj_deselect", "xx", glist_getcanvas(glist), x); @@ -502,7 +502,7 @@ static void *image_new(t_symbol *s, t_int argc, t_atom *argv) } // Create default receiver char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (t_int)x); x->x_receive = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_receive); outlet_new(&x->x_obj, &s_bang); diff --git a/externals/hcs/canvas_name.c b/externals/hcs/canvas_name.c index d8fa11ae0..b71f39653 100644 --- a/externals/hcs/canvas_name.c +++ b/externals/hcs/canvas_name.c @@ -18,7 +18,7 @@ typedef struct _canvas_name static t_symbol* make_canvas_symbol(t_canvas* canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, ".x%lx.c", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING, ".x%zx.c", (t_int)canvas); return gensym(buf); } diff --git a/externals/hcs/colorpanel.c b/externals/hcs/colorpanel.c index b7874085b..1fa9db2a2 100644 --- a/externals/hcs/colorpanel.c +++ b/externals/hcs/colorpanel.c @@ -80,7 +80,7 @@ static void *colorpanel_new( void) { char buf[MAXPDSTRING]; t_colorpanel *x = (t_colorpanel *)pd_new(colorpanel_class); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_int)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_list); diff --git a/externals/hcs/cursor.c b/externals/hcs/cursor.c index c9e6b1c49..34acd5f98 100644 --- a/externals/hcs/cursor.c +++ b/externals/hcs/cursor.c @@ -110,7 +110,7 @@ static void *cursor_new(void) x->parent_canvas = canvas_getcurrent(); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_int)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); x->data_outlet = outlet_new(&x->x_obj, 0); diff --git a/externals/hcs/screensize.c b/externals/hcs/screensize.c index e742ea693..e3b838ec5 100644 --- a/externals/hcs/screensize.c +++ b/externals/hcs/screensize.c @@ -29,7 +29,7 @@ static void *screensize_new(void) char buf[MAXPDSTRING]; t_screensize *x = (t_screensize *)pd_new(screensize_class); - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_int)x); x->receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive_symbol); diff --git a/externals/hcs/sys_gui.c b/externals/hcs/sys_gui.c index 753c19027..4851d70fc 100644 --- a/externals/hcs/sys_gui.c +++ b/externals/hcs/sys_gui.c @@ -65,7 +65,7 @@ static void *sys_gui_new(t_symbol *s) x->x_outlet = outlet_new(&x->x_obj, &s_anything); char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (t_int)x); + sprintf(buf, "#%zx", (t_int)x); x->x_receive_symbol = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_receive_symbol); diff --git a/externals/hcs/window_name.c b/externals/hcs/window_name.c index 0528e9fa2..bdda989c3 100644 --- a/externals/hcs/window_name.c +++ b/externals/hcs/window_name.c @@ -18,7 +18,7 @@ typedef struct _window_name static t_symbol* make_canvas_symbol(t_canvas* canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, ".x%lx", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING, ".x%zx", (t_int)canvas); return gensym(buf); } diff --git a/externals/iem/iemguts/src/receivecanvas.c b/externals/iem/iemguts/src/receivecanvas.c index 1fc10eac6..eca09d6e4 100644 --- a/externals/iem/iemguts/src/receivecanvas.c +++ b/externals/iem/iemguts/src/receivecanvas.c @@ -122,7 +122,7 @@ static void *receivecanvas_new(t_floatarg f) if(canvas) { char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING-1, "x%lx", (long unsigned int)canvas); + snprintf(buf, MAXPDSTRING-1, "x%zx", (t_int)canvas); buf[MAXPDSTRING-1]=0; x->x_proxy=receivecanvas_proxy_new(x, gensym(buf)); diff --git a/externals/miXed/cyclone/hammer/active.c b/externals/miXed/cyclone/hammer/active.c index ccaf2d961..fef61a216 100644 --- a/externals/miXed/cyclone/hammer/active.c +++ b/externals/miXed/cyclone/hammer/active.c @@ -36,7 +36,7 @@ static void *active_new(void) { t_active *x = (t_active *)pd_new(active_class); char buf[32]; - sprintf(buf, ".x%lx.c", (unsigned long)canvas_getcurrent()); + sprintf(buf, ".x%zx.c", (t_int)canvas_getcurrent()); x->x_cvname = gensym(buf); x->x_on = 0; outlet_new((t_object *)x, &s_float); diff --git a/externals/miXed/cyclone/hammer/comment.c b/externals/miXed/cyclone/hammer/comment.c index 634bc9695..e5891b3f9 100644 --- a/externals/miXed/cyclone/hammer/comment.c +++ b/externals/miXed/cyclone/hammer/comment.c @@ -463,10 +463,10 @@ static void comment_select(t_gobj *z, t_glist *glist, int state) sys_vgui(".x%x.c itemconfigure %s -fill %s\n", x->x_canvas, x->x_texttag, (state ? "$select_color" : x->x_color)); if (state && !x->x_dragon) - sys_vgui(".x%lx.c addtag selected withtag %s\n", + sys_vgui(".x%zx.c addtag selected withtag %s\n", glist_getcanvas(glist), x->x_texttag); else if (!x->x_dragon) - sys_vgui(".x%lx.c dtag %s selected\n", + sys_vgui(".x%zx.c dtag %s selected\n", glist_getcanvas(glist), x->x_texttag); /* A regular rtext should now set 'canvas_editing' variable to its canvas, but we do not do that, because we get the keys through a global binding @@ -743,9 +743,9 @@ static void *comment_new(t_symbol *s, int ac, t_atom *av) t->te_type = T_TEXT; x->x_glist = canvas_getcurrent(); x->x_canvas = 0; - sprintf(x->x_tag, "all%lx", (t_int)x); - sprintf(x->x_texttag, "t%lx", (t_int)x); - sprintf(x->x_outlinetag, "h%lx", (t_int)x); + sprintf(x->x_tag, "all%zx", (t_int)x); + sprintf(x->x_texttag, "t%zx", (t_int)x); + sprintf(x->x_outlinetag, "h%zx", (t_int)x); x->x_pixwidth = 0; x->x_fontsize = 0; x->x_fontfamily = 0; @@ -826,7 +826,7 @@ textpart: x->x_transclock = clock_new(x, (t_method)comment_transtick); x->x_bbset = 0; x->x_bbpending = 0; - sprintf(buf, "miXed%lx", (t_int)x); + sprintf(buf, "miXed%zx", (t_int)x); x->x_bindsym = gensym(buf); pd_bind((t_pd *)x, x->x_bindsym); if (!commentsink) diff --git a/externals/miXed/cyclone/hammer/pv.c b/externals/miXed/cyclone/hammer/pv.c index 81feebf0e..1d98ab17b 100644 --- a/externals/miXed/cyclone/hammer/pv.c +++ b/externals/miXed/cyclone/hammer/pv.c @@ -358,11 +358,11 @@ static void pv_objstatus(t_pv *x, t_glist *glist) for (g = glist->gl_list; g; g = g->g_next) { if (g == (t_gobj *)x) - post("%lx (this object) owning patcher [%s]", - (unsigned long)g, glist->gl_name->s_name); + post("%zx (this object) owning patcher [%s]", + (t_int)g, glist->gl_name->s_name); else if (pd_class(&g->g_pd) == pv_class && ((t_pv *)g)->x_name == x->x_name) - post("%lx owning patcher [%s]", (unsigned long)g, glist->gl_name->s_name); + post("%zx owning patcher [%s]", (t_int)g, glist->gl_name->s_name); } } diff --git a/externals/moonlib/image.c b/externals/moonlib/image.c index 0146cdf9b..28cac709e 100644 --- a/externals/moonlib/image.c +++ b/externals/moonlib/image.c @@ -64,8 +64,8 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) glist_istoplevel(glist)); if (x->x_image == &s_) // if we have a blank image name, use the included filler { - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); - sprintf(key2, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd)); + sprintf(key2, "x%zx", (t_int)pd_class(&x->x_obj.te_pd)); strcat(key, key2); strcat(key, "default"); //x->x_image = gensym("::moonlib::image::noimage"); @@ -75,12 +75,12 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } if (x->x_type) { - //sys_vgui(".x%lx.c create image %d %d -tags %xS\n", + //sys_vgui(".x%zx.c create image %d %d -tags %xS\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), // x); - //sys_vgui(".x%lx.c itemconfigure %xS -image %s\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image %s\n", // glist_getcanvas(glist), x, x->x_image->s_name); gui_vmess("gui_gobj_draw_image", "xxss", glist_getcanvas(glist), @@ -90,7 +90,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } else { - sprintf(key, "x%lx", (long unsigned int)x); + sprintf(key, "x%zx", (t_int)x); const char *fname = image_get_filename(x, x->x_image->s_name); if (!x->x_localimage) { @@ -100,12 +100,12 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) if (fname) { /* associate a filename with the image */ - //sys_vgui("::moonlib::image::configure .x%lx img%x {%s}\n", + //sys_vgui("::moonlib::image::configure .x%zx img%x {%s}\n", // x, x, fname); gui_vmess("gui_load_image", "xss", glist_getcanvas(glist), key, fname); } - //sys_vgui(".x%lx.c create image %d %d -image img%x -tags %xS\n", + //sys_vgui(".x%zx.c create image %d %d -image img%x -tags %xS\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -131,7 +131,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) } else { - //sys_vgui(".x%lx.c coords %xS %d %d\n", + //sys_vgui(".x%zx.c coords %xS %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist)); gui_vmess("gui_image_coords", "xxii", @@ -144,7 +144,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime) static void image_erase(t_image *x, t_glist *glist) { - //sys_vgui(".x%lx.c delete %xS\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %xS\n", glist_getcanvas(glist), x); gui_vmess("gui_gobj_erase", "xx", glist_getcanvas(glist), x); } @@ -170,7 +170,7 @@ static void image_displace(t_gobj *z, t_glist *glist, int dx, int dy) t_image *x = (t_image *)z; x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; - //sys_vgui(".x%lx.c coords %xSEL %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %xSEL %d %d %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -185,7 +185,7 @@ static void image_displace_wtag(t_gobj *z, t_glist *glist, int dx, int dy) t_image *x = (t_image *)z; x->x_obj.te_xpix += dx; x->x_obj.te_ypix += dy; - //sys_vgui(".x%lx.c coords %xSEL %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %xSEL %d %d %d %d\n", // glist_getcanvas(glist), x, // text_xpix(&x->x_obj, glist), // text_ypix(&x->x_obj, glist), @@ -200,7 +200,7 @@ static void image_select(t_gobj *z, t_glist *glist, int state) t_image *x = (t_image *)z; //if (state) //{ - // sys_vgui(".x%lx.c create rectangle " + // sys_vgui(".x%zx.c create rectangle " // "%d %d %d %d -tags %xSEL -outline blue\n", // glist_getcanvas(glist), // text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), @@ -210,7 +210,7 @@ static void image_select(t_gobj *z, t_glist *glist, int state) //} //else //{ - // sys_vgui(".x%lx.c delete %xSEL\n", + // sys_vgui(".x%zx.c delete %xSEL\n", // glist_getcanvas(glist), x); //} gui_vmess("gui_image_toggle_border", "xxi", @@ -283,7 +283,7 @@ static void image_open(t_gobj *z, t_symbol *file) fname = image_get_filename(x, file->s_name); if (fname) { - sprintf(key, "x%lx", (long unsigned int)x); + sprintf(key, "x%zx", (t_int)x); x->x_image = gensym(fname); x->x_key = gensym(key); x->x_type = 0; @@ -295,13 +295,13 @@ static void image_open(t_gobj *z, t_symbol *file) x->x_localimage = 1; } //sys_vgui("img%x blank\n", x); - //sys_vgui("::moonlib::image::configure .x%lx img%x {%s}\n", + //sys_vgui("::moonlib::image::configure .x%zx img%x {%s}\n", // x, x, fname); gui_vmess("gui_load_image", "xss", glist_getcanvas(x->x_glist), key, fname); if (oldtype == 0) { - //sys_vgui(".x%lx.c itemconfigure %xS -image img%x\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image img%x\n", // glist_getcanvas(x->x_glist), x, x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->x_glist), @@ -323,11 +323,11 @@ static void image_load(t_gobj *z, t_symbol *image, t_symbol *file) fname = image_get_filename(x, file->s_name); if (fname) { - //sys_vgui("::moonlib::image::create_photo .x%lx %s {%s}\n", + //sys_vgui("::moonlib::image::create_photo .x%zx %s {%s}\n", // x, image->s_name, fname); /* For these class-accessible names, we prefix the user-provided name with a class pointer. */ - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); gui_vmess("gui_load_image", "xss", glist_getcanvas(x->x_glist), key, fname); @@ -343,14 +343,14 @@ static void image_set(t_gobj *z, t_symbol *image) char key[MAXPDSTRING]; t_image *x = (t_image *)z; /* key is the class address followed by the user-supplied string */ - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); x->x_image = image; x->x_key = gensym(key); x->x_type = 1; if (glist_isvisible(x->x_glist)) { - //sys_vgui(".x%lx.c itemconfigure %xS -image %s\n", + //sys_vgui(".x%zx.c itemconfigure %xS -image %s\n", // glist_getcanvas(x->x_glist), x, x->x_image->s_name); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->x_glist), @@ -394,7 +394,7 @@ static void *image_new(t_symbol *image, t_float type) { if (x->x_type) { - sprintf(key, "x%lx", (long unsigned int)pd_class(&x->x_obj.te_pd)); + sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd)); strcat(key, image->s_name); x->x_image = image; x->x_key = gensym(key); @@ -434,13 +434,13 @@ void image_setup(void) class_setsavefn(image_class, &image_save); #endif /* cache a default image (question mark) for case where no image argument - is given. The key is ("x%lxx%lxdefault", image_class, image_class), + is given. The key is ("x%zxx%zxdefault", image_class, image_class), to protect against namespace clashes with the complicated interface of moonlib/image */ char key[MAXPDSTRING]; char key2[MAXPDSTRING]; - sprintf(key, "x%lx", (long unsigned int)image_class); - sprintf(key2, "x%lx", (long unsigned int)image_class); + sprintf(key, "x%zx", (t_int)image_class); + sprintf(key2, "x%zx", (t_int)image_class); strcat(key, key2); strcat(key, "default"); gui_vmess("gui_load_default_image", "ss", "dummy", key); diff --git a/externals/mrpeach/net/udpreceive.c b/externals/mrpeach/net/udpreceive.c index 231c99f5c..df907c743 100644 --- a/externals/mrpeach/net/udpreceive.c +++ b/externals/mrpeach/net/udpreceive.c @@ -271,7 +271,7 @@ static void udpreceive_sock_err(t_udpreceive *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, dwRetVal); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, dwRetVal); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpreceive~.c b/externals/mrpeach/net/udpreceive~.c index 9768baa54..b3f835b15 100644 --- a/externals/mrpeach/net/udpreceive~.c +++ b/externals/mrpeach/net/udpreceive~.c @@ -223,7 +223,7 @@ static void udpreceive_tilde_datapoll(t_udpreceive_tilde *x) if (!((tag_ptr->tag[0] == 'T')&&(tag_ptr->tag[1] == 'A')&&(tag_ptr->tag[2] == 'G')&&(tag_ptr->tag[3] == '!'))) { ++x->x_tag_errors; - if (x->x_sync) error("udpreceive~: bad header tag (%d)", x->x_tag_errors); + if (x->x_sync) error("udpreceive~: bad header tag (%ld)", x->x_tag_errors); x->x_sync = 0; /* tag length is 16 bytes, a multiple of the data frame size, so eventually we should resync on a tag */ return; @@ -849,7 +849,7 @@ static void udpreceive_tilde_sock_err(t_udpreceive_tilde *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, dwRetVal); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, dwRetVal); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpsend.c b/externals/mrpeach/net/udpsend.c index cbef2f874..1e06f304d 100644 --- a/externals/mrpeach/net/udpsend.c +++ b/externals/mrpeach/net/udpsend.c @@ -414,7 +414,7 @@ static void udpsend_sock_err(t_udpsend *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, errornumber); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, errornumber); LocalFree(lpMsgBuf); } #else diff --git a/externals/mrpeach/net/udpsend~.c b/externals/mrpeach/net/udpsend~.c index 77b514c0f..ebdbbed34 100644 --- a/externals/mrpeach/net/udpsend~.c +++ b/externals/mrpeach/net/udpsend~.c @@ -970,7 +970,7 @@ static void udpsend_tilde_sock_err(t_udpsend_tilde *x, char *err_string) break; } } - pd_error(x, "%s: %s (%d)", err_string, lpMsgBuf, errornumber); + pd_error(x, "%s: %s (%ld)", err_string, lpMsgBuf, errornumber); LocalFree(lpMsgBuf); } #else diff --git a/externals/tof/src/folderpanel.c b/externals/tof/src/folderpanel.c index e4a5a8fee..9befda795 100644 --- a/externals/tof/src/folderpanel.c +++ b/externals/tof/src/folderpanel.c @@ -57,7 +57,7 @@ static void *folderpanel_new( void) { char buf[50]; t_folderpanel *x = (t_folderpanel *)pd_new(folderpanel_class); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_int)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_symbol); diff --git a/externals/tof/src/imagebang.c b/externals/tof/src/imagebang.c index 501991b39..54a9d6fa0 100644 --- a/externals/tof/src/imagebang.c +++ b/externals/tof/src/imagebang.c @@ -46,7 +46,7 @@ static void imagebang_bang(t_imagebang *x) clock_delay(x->clock_brk, 50); //x->flashed = 1; // key_a: - sprintf(image_key, "%lx_a", (long unsigned int)x); + sprintf(image_key, "%zx_a", (t_int)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -58,7 +58,7 @@ static void imagebang_bang(t_imagebang *x) sys_vgui(".x%x.c itemconfigure %ximage -image %x_imagebang \n", glist, x,x->image_b); // key_b: - sprintf(image_key, "%lx_b", (long unsigned int)x); + sprintf(image_key, "%zx_b", (t_int)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -78,7 +78,7 @@ static void imagebang_flash_timeout(t_imagebang *x) t_glist* glist = glist_getcanvas(x->glist); char key_a[MAXPDSTRING]; x->flashing = 0; - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_int)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -97,7 +97,7 @@ static void imagebang_brk_timeout(t_imagebang *x) x->flashing = 1; //sys_vgui(".x%x.c itemconfigure %ximage -image %x_imagebang \n", // glist, x,x->image_b); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_b, "%zx_b", (t_int)x); gui_vmess("gui_image_configure", "xxss", glist_getcanvas(x->glist), x, @@ -153,7 +153,7 @@ static void imagebang_drawme(t_imagebang *x, t_glist *glist, int firsttime) text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist), glist_istoplevel(glist)); - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_int)x); gui_vmess("gui_gobj_draw_image", "xxss", glist_getcanvas(glist), x, @@ -303,8 +303,8 @@ static void imagebang_free(t_imagebang *x) { DEBUG(sys_vgui("pd [concat DEBUG b exists [info exists %x_imagebang] \\;]\n",x->image_b);) DEBUG(sys_vgui("pd [concat DEBUG a exists [info exists %x_imagebang] \\;]\n",x->image_a);) - sprintf(key_a, "%lx_a", (long unsigned int)x); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_int)x); + sprintf(key_b, "%zx_b", (t_int)x); gui_vmess("gui_image_free", "s", key_a); gui_vmess("gui_image_free", "s", key_b); if (x->receive) { @@ -352,7 +352,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) if ( argc && (argv)->a_type == A_SYMBOL ) { image_a= atom_getsymbol(argv); - sprintf(key_a, "%lx_a", (long unsigned int)x); + sprintf(key_a, "%zx_a", (t_int)x); // Get image file path fname = imagebang_get_filename(x,image_a->s_name); @@ -385,7 +385,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) if ( argc > 1 && (argv+1)->a_type == A_SYMBOL ) { image_b= atom_getsymbol(argv+1); - sprintf(key_b, "%lx_b", (long unsigned int)x); + sprintf(key_b, "%zx_b", (t_int)x); // Get image file path fname = imagebang_get_filename(x,image_b->s_name); @@ -436,7 +436,7 @@ static void *imagebang_new(t_symbol *s, int argc, t_atom *argv) { // Create default receiver if none set char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (long)x); x->receive = gensym(buf); } diff --git a/externals/tof/test/imagebutton.c b/externals/tof/test/imagebutton.c index 2e2bddd19..2c1a1ab12 100644 --- a/externals/tof/test/imagebutton.c +++ b/externals/tof/test/imagebutton.c @@ -345,7 +345,7 @@ static void *imagebutton_new(t_symbol *s, int argc, t_atom *argv) return NULL; } char buf[MAXPDSTRING]; - sprintf(buf, "#%lx", (long)x); + sprintf(buf, "#%zx", (long)x); x->receive = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->receive ); diff --git a/externals/unauthorized/cooled~.c b/externals/unauthorized/cooled~.c index c09ba4c4e..61e5faacb 100644 --- a/externals/unauthorized/cooled~.c +++ b/externals/unauthorized/cooled~.c @@ -238,7 +238,7 @@ static void cooled_update_block(t_cooled *x, t_glist *glist, int bnumber) for ( i=0; i<x->x_zoom; i++ ) { - sprintf( x->x_guicommand, "COOLEDIMAGE%lx put {%s} -to %d 0\n", (long unsigned int)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); + sprintf( x->x_guicommand, "COOLEDIMAGE%zx put {%s} -to %d 0\n", (t_int)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); if ( glist_isvisible( x->x_glist ) ) sys_gui( x->x_guicommand ); } diff --git a/externals/unauthorized/pianoroll.c b/externals/unauthorized/pianoroll.c index 887b13fad..2c9145ab6 100644 --- a/externals/unauthorized/pianoroll.c +++ b/externals/unauthorized/pianoroll.c @@ -732,7 +732,7 @@ static void pianoroll_load(t_pianoroll *x, t_symbol *ffile) freebytes( x->x_ipeaches, x->x_nbsteps*sizeof( t_int ) ); freebytes( x->x_ivolumes, x->x_nbsteps*sizeof( t_int ) ); - if ( fscanf(tmph, "%d %d %f %f %d %d %d %f %d", + if ( fscanf(tmph, "%d %d %f %f %zd %zd %zd %f %d", &x->x_width, &x->x_height, &x->x_pmin, &x->x_pmax, &x->x_nbgrades, &x->x_nbsteps, diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c index 459fd2852..f2ffc0e22 100644 --- a/pd/src/d_ugen.c +++ b/pd/src/d_ugen.c @@ -304,14 +304,14 @@ void dsp_add(t_perfroutine f, int n, ...) pd_this->pd_dspchainsize * sizeof (t_int), newsize * sizeof (t_int)); pd_this->pd_dspchain[pd_this->pd_dspchainsize-1] = (t_int)f; if (ugen_loud) - post("add to chain: %lx", + post("add to chain: %zx", pd_this->pd_dspchain[pd_this->pd_dspchainsize-1]); va_start(ap, n); for (i = 0; i < n; i++) { pd_this->pd_dspchain[pd_this->pd_dspchainsize + i] = va_arg(ap, t_int); if (ugen_loud) - post("add to chain: %lx", + post("add to chain: %zx", pd_this->pd_dspchain[pd_this->pd_dspchainsize + i]); } va_end(ap); @@ -402,7 +402,7 @@ void signal_makereusable(t_signal *sig) } } #endif - if (ugen_loud) post("free %lx: %d", sig, sig->s_isborrowed); + if (ugen_loud) post("free %zx: %d", sig, sig->s_isborrowed); if (sig->s_isborrowed) { /* if the signal is borrowed, decrement the borrowed-from signal's @@ -471,7 +471,7 @@ t_signal *signal_new(int n, t_float sr) ret->s_sr = sr; ret->s_refcount = 0; ret->s_borrowedfrom = 0; - if (ugen_loud) post("new %lx: %lx", ret, ret->s_vec); + if (ugen_loud) post("new %zx: %zx", ret, ret->s_vec); return (ret); } @@ -490,7 +490,7 @@ void signal_setborrowed(t_signal *sig, t_signal *sig2) sig->s_vec = sig2->s_vec; sig->s_n = sig2->s_n; sig->s_vecsize = sig2->s_vecsize; - if (ugen_loud) post("set borrowed %lx: %lx", sig, sig->s_vec); + if (ugen_loud) post("set borrowed %zx: %zx", sig, sig->s_vec); } int signal_compatible(t_signal *s1, t_signal *s2) @@ -815,12 +815,12 @@ static void ugen_doit(t_dspcontext *dc, t_ugenbox *u) { if (u->u_nin + u->u_nout == 0) post("put %s %d", class_getname(u->u_obj->ob_pd), ugen_index(dc, u)); - else if (u->u_nin + u->u_nout == 1) post("put %s %d (%lx)", + else if (u->u_nin + u->u_nout == 1) post("put %s %d (%zx)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0]); - else if (u->u_nin + u->u_nout == 2) post("put %s %d (%lx %lx)", + else if (u->u_nin + u->u_nout == 2) post("put %s %d (%zx %zx)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0], sig[1]); - else post("put %s %d (%lx %lx %lx ...)", + else post("put %s %d (%zx %zx %zx ...)", class_getname(u->u_obj->ob_pd), ugen_index(dc, u), sig[0], sig[1], sig[2]); } @@ -1000,7 +1000,7 @@ void ugen_done_graph(t_dspcontext *dc) signal_new(parent_vecsize, parent_srate)); (*sigp)->s_refcount++; - if (ugen_loud) post("set %lx->%lx", *sigp, + if (ugen_loud) post("set %zx->%zx", *sigp, (*sigp)->s_borrowedfrom); } } @@ -1083,7 +1083,7 @@ void ugen_done_graph(t_dspcontext *dc) (*sigp)->s_refcount++; dsp_add_zero(s3->s_vec, s3->s_n); if (ugen_loud) - post("oops, belatedly set %lx->%lx", *sigp, + post("oops, belatedly set %zx->%zx", *sigp, (*sigp)->s_borrowedfrom); } } @@ -1123,7 +1123,7 @@ void ugen_done_graph(t_dspcontext *dc) if (!dc->dc_parentcontext) for (i = pd_this->pd_dspchainsize, ip = pd_this->pd_dspchain; i--; ip++) - post("chain %lx", *ip); + post("chain %zx", *ip); post("... ugen_done_graph done."); } /* now delete everything. */ diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c index 7830086e6..d920eecb1 100644 --- a/pd/src/g_all_guis.c +++ b/pd/src/g_all_guis.c @@ -489,8 +489,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, // new interface, but we haven't had a need to do it yet //fprintf(stderr,"%f %d %d\n", width_multiplier, // label_length, x_gui.x_font_style); - //sys_vgui(".x%lx.c delete iemguiDEBUG\n", x); - //sys_vgui(".x%lx.c create rectangle %d %d %d %d " + //sys_vgui(".x%zx.c delete iemguiDEBUG\n", x); + //sys_vgui(".x%zx.c create rectangle %d %d %d %d " // "-tags iemguiDEBUG\n", // x, label_x1, label_y1, label_x2, label_y2); if (label_x1 < *xp1) *xp1 = label_x1; @@ -498,8 +498,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, if (label_y1 < *yp1) *yp1 = label_y1; if (label_y2 > *yp2) *yp2 = label_y2; //DEBUG - //sys_vgui(".x%lx.c delete iemguiDEBUG\n", x); - //sys_vgui(".x%lx.c create rectangle %d %d %d %d " + //sys_vgui(".x%zx.c delete iemguiDEBUG\n", x); + //sys_vgui(".x%zx.c create rectangle %d %d %d %d " // "-tags iemguiDEBUG\n", x, *xp1, *yp1, *xp2, *yp2); } } @@ -525,8 +525,8 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, if (yr) { fprintf(stderr,"lower\n"); - sys_vgui(".x%lx.c lower selected %s\n", canvas, rtext_gettag(yr)); - sys_vgui(".x%lx.c raise selected %s\n", canvas, rtext_gettag(yr)); + sys_vgui(".x%zx.c lower selected %s\n", canvas, rtext_gettag(yr)); + sys_vgui(".x%zx.c raise selected %s\n", canvas, rtext_gettag(yr)); //canvas_raise_all_cords(canvas); } else @@ -542,7 +542,7 @@ void iemgui_label_getrect(t_iemgui x_gui, t_glist *x, // we get here if we are supposed to go // all the way to the bottom fprintf(stderr,"lower to the bottom\n"); - sys_vgui(".x%lx.c lower selected\n", canvas); + sys_vgui(".x%zx.c lower selected\n", canvas); } glist_noselect(canvas); */ @@ -939,20 +939,20 @@ t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, t_clickhandlefn chf, t_motionhandlefn mhf) { t_scalehandle *h = (t_scalehandle *)pd_new(scalehandle_class); - char buf[19]; // 3 + max size of %lx + char buf[19]; // 3 + max size of %zx h->h_master = x; h->h_glist = glist; if (!scale) /* Only bind for labels-- scaling uses pd_vmess in g_editor.c */ { - sprintf(buf, "_l%lx", (long unsigned int)x); + sprintf(buf, "_l%zx", (t_int)x); pd_bind((t_pd *)h, h->h_bindsym = gensym(buf)); } else if (scale && pd_class((t_pd *)x) == my_canvas_class) { - sprintf(buf, "_s%lx", (long unsigned int)x); + sprintf(buf, "_s%zx", (t_int)x); pd_bind((t_pd *)h, h->h_bindsym = gensym(buf)); } - sprintf(h->h_outlinetag, "h%lx", (t_int)h); + sprintf(h->h_outlinetag, "h%zx", (t_int)h); h->h_dragon = 0; h->h_scale = scale; h->h_offset_x = 0; @@ -961,7 +961,7 @@ t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, h->h_adjust_y = 0; h->h_vis = 0; h->h_constrain = 0; - sprintf(h->h_pathname, ".x%lx.h%lx", (t_int)h->h_glist, (t_int)h); + sprintf(h->h_pathname, ".x%zx.h%zx", (t_int)h->h_glist, (t_int)h); h->h_clickfn = chf; h->h_motionfn = mhf; return h; @@ -976,10 +976,10 @@ void scalehandle_free(t_scalehandle *h) pd_free((t_pd *)h); } -void properties_set_field_int(long props, const char *gui_field, int value) +void properties_set_field_int(t_int props, const char *gui_field, int value) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", props); + sprintf(tagbuf, ".gfxstub%zx", props); gui_vmess("gui_dialog_set_field", "ssi", tagbuf, gui_field, @@ -1036,7 +1036,7 @@ void scalehandle_click_label(t_scalehandle *h) { //sys_vgui("lower %s\n", h->h_pathname); //t_scalehandle *othersh = x->x_handle; - //sys_vgui("lower .x%lx.h%lx\n", + //sys_vgui("lower .x%zx.h%zx\n", // (t_int)glist_getcanvas(x->x_glist), (t_int)othersh); } h->h_dragx = 0; @@ -1177,7 +1177,7 @@ void iemgui_label_draw_move(t_iemgui *x) //int x1=text_xpix(&x->x_obj, x->x_glist)+x->legacy_x; //int y1=text_ypix(&x->x_obj, x->x_glist)+x->legacy_y; //iemgui_getrect_legacy_label(x, &x1, &y1); - //sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", + //sys_vgui(".x%zx.c coords %zxLABEL %d %d\n", // canvas, x, x1+x->x_ldx, y1+x->x_ldy); /* Note-- since we're not using x1/y1 above in the new GUI call, @@ -1286,7 +1286,7 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) n = 0; int a=old_sr_flags&IEM_GUI_OLD_SND_FLAG; int b=x->x_snd!=s_empty; - //fprintf(stderr, "%lx SND: old_sr_flags=%d SND_FLAG=%d || " + //fprintf(stderr, "%zx SND: old_sr_flags=%d SND_FLAG=%d || " // "OUTCOME: OLD_SND_FLAG=%d not_empty=%d\n", // (t_int)x, old_sr_flags, IEM_GUI_OLD_SND_FLAG, a, b); @@ -1312,7 +1312,7 @@ void iemgui_draw_io(t_iemgui *x, int old_sr_flags) } a = old_sr_flags & IEM_GUI_OLD_RCV_FLAG; b = x->x_rcv != s_empty; - //fprintf(stderr, "%lx RCV: old_sr_flags=%d RCV_FLAG=%d || " + //fprintf(stderr, "%zx RCV: old_sr_flags=%d RCV_FLAG=%d || " // "OUTCOME: OLD_RCV_FLAG=%d not_empty=%d\n", // (t_int)x, old_sr_flags, IEM_GUI_OLD_RCV_FLAG, a, b); if (a && !b) @@ -1425,7 +1425,7 @@ void iemgui_base_draw_config(t_iemgui *x) char fcol[8]; sprintf(fcol,"#%6.6x", x->x_fcol); char tagbuf[MAXPDSTRING]; char bcol[8]; sprintf(bcol, "#%6.6x", x->x_bcol); - sprintf(tagbuf, "x%lxborder", (long unsigned int)x); + sprintf(tagbuf, "x%zxborder", (t_int)x); gui_vmess("gui_iemgui_base_color", "xxs", canvas, x, bcol); } diff --git a/pd/src/g_all_guis.h b/pd/src/g_all_guis.h index 19d2d46db..d7dec8359 100644 --- a/pd/src/g_all_guis.h +++ b/pd/src/g_all_guis.h @@ -47,8 +47,8 @@ typedef struct _scalehandle t_glist *h_glist; // this is the canvas to draw on. Note that when objects are edited, "glist" and "canvas" mean the same. t_symbol *h_bindsym; int h_scale; - char h_pathname[37]; // max size for ".x%lx.h%lx" = 5+4*sizeof(long) - char h_outlinetag[18]; // max size for "h%lx" = 2+2*sizeof(long) + char h_pathname[37]; // max size for ".x%llx.h%llx" = 5+4*sizeof(long) + char h_outlinetag[18]; // max size for "h%llx" = 2+2*sizeof(long) int h_dragon; // bool int h_dragx; int h_dragy; @@ -244,7 +244,7 @@ EXTERN void scalehandle_draw_erase2(t_iemgui *x); EXTERN void scalehandle_draw(t_iemgui *x); EXTERN t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale, t_clickhandlefn chf, t_motionhandlefn mhf); EXTERN void scalehandle_free(t_scalehandle *h); -EXTERN void properties_set_field_int(long props, const char *gui_field, int value); +EXTERN void properties_set_field_int(t_int props, const char *gui_field, int value); EXTERN void scalehandle_dragon_label(t_scalehandle *h, float f1, float f2); EXTERN void scalehandle_click_label(t_scalehandle *h); EXTERN void scalehandle_click_scale(t_scalehandle *h); diff --git a/pd/src/g_array.c b/pd/src/g_array.c index fac752ac0..a2b133bcf 100644 --- a/pd/src/g_array.c +++ b/pd/src/g_array.c @@ -545,8 +545,8 @@ void canvas_menuarray(t_glist *canvas) gui_vmess("gui_array_new", "si", gfxstub_new2(&x->gl_pd, x), gcount); - //sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1 .x%lx black black\n", - // ++gcount, (long unsigned int)canvas); + //sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1 .x%zx black black\n", + // ++gcount, (t_int)canvas); //gfxstub_new(&x->gl_pd, x, cmdbuf); } @@ -583,12 +583,12 @@ int garray_properties(t_garray *x, t_symbol **gfxstubp, t_symbol **namep, *fillp = x->x_fillcolor; *outlinep = x->x_outlinecolor; //sprintf(cmdbuf, ((x->x_name->s_name[0] == '$') ? - // "pdtk_array_dialog %%s \\%s %d %d 0 .x%lx %s %s\n" : - // "pdtk_array_dialog %%s %s %d %d 0 .x%lx %s %s\n"), + // "pdtk_array_dialog %%s \\%s %d %d 0 .x%zx %s %s\n" : + // "pdtk_array_dialog %%s %s %d %d 0 .x%zx %s %s\n"), // x->x_name->s_name, // a->a_n, // x->x_saveit + 2 * filestyle + 8 * x->x_hidename + 16 * x->x_joc, - // (long unsigned int)glist_getcanvas(canvas), + // (t_int)glist_getcanvas(canvas), // x->x_fillcolor->s_name, // x->x_outlinecolor->s_name); //gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); @@ -1348,7 +1348,7 @@ static void garray_select(t_gobj *z, t_glist *glist, int state) t_garray *x = (t_garray *)z; /* There's no replacement for the following command in the new GUI, but it looks like it's not needed anymore. */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), x->x_glist, state); extern void scalar_select(t_gobj *z, t_glist *owner, int state); @@ -1502,7 +1502,7 @@ static void garray_doredraw(t_gobj *client, t_glist *glist) canvas_restore_original_position(glist_getcanvas(glist), (t_gobj *)glist, 0, -1); } - //fprintf(stderr,"check if we need to reselect %lx %lx %lx\n", + //fprintf(stderr,"check if we need to reselect %zx %zx %zx\n", // glist_getcanvas(glist), (t_gobj *)glist, glist->gl_owner); int selected = 0; /* Unfortunately I forget to comment this. I can't remember why I @@ -1525,13 +1525,13 @@ static void garray_doredraw(t_gobj *client, t_glist *glist) perhaps with nested GOPs or something? Anyhow if there's a regression this commented-out call might be a place to investigate... */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), glist, 1); // a giant kludge-- we really just need gop items // to be children of their gop <group> t_scalar *sc = x->x_scalar; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)sc->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)sc->sc_vec); gui_vmess("gui_gobj_select", "xs", glist_getcanvas(glist), tagbuf); } diff --git a/pd/src/g_bang.c b/pd/src/g_bang.c index 3667629de..00d2b0be8 100644 --- a/pd/src/g_bang.c +++ b/pd/src/g_bang.c @@ -49,9 +49,9 @@ void bng_draw_new(t_bng *x, t_glist *glist) /* The circle isn't quite centered in the nw.js port. Let's use the old interface to see if there's anything we're doing wrong. Then once we get the circle placement right we can remove the old code here... */ - //sys_vgui(".x%lx.c create circle %f %f -r %f " + //sys_vgui(".x%zx.c create circle %f %f -r %f " // "-stroke $pd_colors(iemgui_border) -fill #%6.6x " - // "-tags {%lxBUT x%lx text iemgui border}\n", + // "-tags {%zxBUT x%zx text iemgui border}\n", // canvas, cx, cy, cr, x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, // x, x); gui_vmess("gui_bng_new", "xxfff", diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 553864b17..e61be8be6 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -98,7 +98,7 @@ void canvas_updatewindowlist( void) if (x->gl_havewindow) { gui_s(x->gl_name->s_name); - gui_x((long unsigned int)x); + gui_x((t_int)x); } } } @@ -424,7 +424,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) x->gl_obj.te_type = T_OBJECT; if (!owner) canvas_addtolist(x); - /* post("canvas %lx, owner %lx", x, owner); */ + /* post("canvas %zx, owner %zx", x, owner); */ if (argc == 5) /* toplevel: x, y, w, h, font */ { @@ -489,7 +489,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) canvas_bind(x); x->gl_loading = 1; x->gl_unloading = 0; - //fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", (t_int)x, (t_int)x->gl_owner); + //fprintf(stderr,"loading = 1 .x%zx owner=.x%zx\n", (t_int)x, (t_int)x->gl_owner); x->gl_goprect = 0; /* no GOP rectangle unless it's turned on later */ /* cancel "vis" flag if we're a subpatch of an abstraction inside another patch. A separate mechanism prevents @@ -845,9 +845,9 @@ void canvas_draw_gop_resize_hooks(t_canvas* x) x->gl_goprect && !x->gl_editor->e_selection) { //Drawing and Binding Resize_Blob for GOP - //fprintf(stderr,"draw_gop_resize_hooks DRAW %lx %lx\n", (t_int)x, (t_int)glist_getcanvas(x)); - sprintf(sh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)sh); - sprintf(mh->h_pathname, ".x%lx.h%lx", (t_int)x, (t_int)mh); + //fprintf(stderr,"draw_gop_resize_hooks DRAW %zx %zx\n", (t_int)x, (t_int)glist_getcanvas(x)); + sprintf(sh->h_pathname, ".x%zx.h%zx", (t_int)x, (t_int)sh); + sprintf(mh->h_pathname, ".x%zx.h%zx", (t_int)x, (t_int)mh); /* These are handled now in canvas_doclick */ //scalehandle_draw_select(sh, @@ -898,7 +898,7 @@ void canvas_drawredrect(t_canvas *x, int doit) called from the GUI after the fact to "notify" us that we're mapped. */ void canvas_map(t_canvas *x, t_floatarg f) { - //fprintf(stderr,"canvas_map %lx %f\n", (t_int)x, f); + //fprintf(stderr,"canvas_map %zx %f\n", (t_int)x, f); int flag = (f != 0); t_gobj *y; if (flag) @@ -952,7 +952,7 @@ void canvas_map(t_canvas *x, t_floatarg f) void canvas_redraw(t_canvas *x) { if (do_not_redraw) return; - //fprintf(stderr,"canvas_redraw %lx\n", (t_int)x); + //fprintf(stderr,"canvas_redraw %zx\n", (t_int)x); if (glist_isvisible(x)) { //fprintf(stderr,"canvas_redraw glist_isvisible=true\n"); @@ -995,7 +995,7 @@ void glist_menu_open(t_glist *x) else { // Not sure if this needs to get ported... need to test - //sys_vgui("focus .x%lx\n", (t_int)x); + //sys_vgui("focus .x%zx\n", (t_int)x); } } else @@ -1032,7 +1032,7 @@ extern void canvas_group_free(t_pd *x); void canvas_free(t_canvas *x) { - //fprintf(stderr,"canvas_free %lx\n", (t_int)x); + //fprintf(stderr,"canvas_free %zx\n", (t_int)x); t_gobj *y; int dspstate = canvas_suspend_dsp(); @@ -1120,7 +1120,7 @@ void canvas_deletelinesfor(t_canvas *x, t_text *text) { /* Still don't see any place where this gets used. Maybe it's used by older externals? Need to test... */ - //sys_vgui(".x%lx.c delete l%lx\n", + //sys_vgui(".x%zx.c delete l%zx\n", // glist_getcanvas(x), oc); /* probably need a gui_vmess here */ } @@ -1143,7 +1143,7 @@ void canvas_eraselinesfor(t_canvas *x, t_text *text) if (x->gl_editor) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_delete_line", "xs", glist_getcanvas(x), tagbuf); } @@ -1167,7 +1167,7 @@ void canvas_deletelinesforio(t_canvas *x, t_text *text, if (x->gl_editor) { char buf[MAXPDSTRING]; - sprintf(buf, "l%lx", (long unsigned int)oc); + sprintf(buf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_delete_line", "xs", glist_getcanvas(x), buf); @@ -1185,7 +1185,7 @@ static void canvas_pop(t_canvas *x, t_floatarg fvis) canvas_resortinlets(x); canvas_resortoutlets(x); x->gl_loading = 0; - //fprintf(stderr,"loading = 0 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 0 .x%zx owner=.x%zx\n", x, x->gl_owner); } extern void *svg_new(t_pd *x, t_symbol *s, int argc, t_atom *argv); @@ -1205,7 +1205,7 @@ void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { t_pd *z; int is_draw_command = 0; - //fprintf(stderr,"canvas_restore %lx\n", x); + //fprintf(stderr,"canvas_restore %zx\n", x); /* for [draw g] and [draw svg] we add an inlet to the svg attr proxy */ if (atom_getsymbolarg(2, argc, argv) == gensym("draw")) { @@ -1248,7 +1248,7 @@ void canvas_loadbangsubpatches(t_canvas *x, t_symbol *s) { if (!canvas_isabstraction((t_canvas *)y)) { - //fprintf(stderr,"%lx s:canvas_loadbangsubpatches %s\n", + //fprintf(stderr,"%zx s:canvas_loadbangsubpatches %s\n", // x, s->s_name); canvas_loadbangsubpatches((t_canvas *)y, s); } @@ -1257,7 +1257,7 @@ void canvas_loadbangsubpatches(t_canvas *x, t_symbol *s) if ((pd_class(&y->g_pd) != canvas_class) && zgetfn(&y->g_pd, s)) { - //fprintf(stderr,"%lx s:obj_loadbang %s\n",x,s->s_name); + //fprintf(stderr,"%zx s:obj_loadbang %s\n",x,s->s_name); pd_vmess(&y->g_pd, s, "f", (t_floatarg)LB_LOAD); } } @@ -1271,13 +1271,13 @@ static void canvas_loadbangabstractions(t_canvas *x, t_symbol *s) { if (canvas_isabstraction((t_canvas *)y)) { - //fprintf(stderr,"%lx a:canvas_loadbang %s\n",x,s->s_name); + //fprintf(stderr,"%zx a:canvas_loadbang %s\n",x,s->s_name); canvas_loadbangabstractions((t_canvas *)y, s); canvas_loadbangsubpatches((t_canvas *)y, s); } else { - //fprintf(stderr,"%lx a:canvas_loadbangabstractions %s\n", + //fprintf(stderr,"%zx a:canvas_loadbangabstractions %s\n", // x, s->s_name); canvas_loadbangabstractions((t_canvas *)y, s); } @@ -1288,14 +1288,14 @@ void canvas_loadbang(t_canvas *x) { //t_gobj *y; // first loadbang preset hubs and nodes - //fprintf(stderr,"%lx 0\n", x); + //fprintf(stderr,"%zx 0\n", x); canvas_loadbangabstractions(x, gensym("pre-loadbang")); canvas_loadbangsubpatches(x, gensym("pre-loadbang")); - //fprintf(stderr,"%lx 1\n", x); + //fprintf(stderr,"%zx 1\n", x); // then do the regular loadbang canvas_loadbangabstractions(x, gensym("loadbang")); canvas_loadbangsubpatches(x, gensym("loadbang")); - //fprintf(stderr,"%lx 2\n", x); + //fprintf(stderr,"%zx 2\n", x); } /* JMZ/MSP: @@ -1432,11 +1432,11 @@ void canvas_popabstraction(t_canvas *x) pd_bind(newest, gensym("#A")); pd_popsym(&x->gl_pd); //x->gl_loading = 1; - //fprintf(stderr,"loading = 1 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 1 .x%zx owner=.x%zx\n", x, x->gl_owner); canvas_resortinlets(x); canvas_resortoutlets(x); x->gl_loading = 0; - //fprintf(stderr,"loading = 0 .x%lx owner=.x%lx\n", x, x->gl_owner); + //fprintf(stderr,"loading = 0 .x%zx owner=.x%zx\n", x, x->gl_owner); } void canvas_logerror(t_object *y) @@ -1454,7 +1454,7 @@ static void *subcanvas_new(t_symbol *s) { t_atom a[6]; t_canvas *x, *z = canvas_getcurrent(); - //fprintf(stderr,"subcanvas_new current canvas .x%lx\n", (t_int)z); + //fprintf(stderr,"subcanvas_new current canvas .x%zx\n", (t_int)z); if (!*s->s_name) s = gensym("/SUBPATCH/"); SETFLOAT(a, 0); SETFLOAT(a+1, GLIST_DEFCANVASYLOC); @@ -1851,7 +1851,7 @@ static void glist_redrawall(t_template *template, t_glist *gl, int action) { /* Haven't tested scalars inside gop yet, but we probably need a gui_vmess here */ - sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", glist_getcanvas(gl), gl, 1); } } @@ -2275,7 +2275,7 @@ static void canvas_f(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { static int warned_future_version; static int warned_old_syntax; - //fprintf(stderr,"canvas_f %lx %d current=%lx %s\n", + //fprintf(stderr,"canvas_f %zx %d current=%zx %s\n", // (t_int)x, argc, canvas_getcurrent(), // last_typedmess != NULL ? last_typedmess->s_name : "none"); t_canvas *xp = x; //parent window for a special case dealing with subpatches @@ -2310,7 +2310,7 @@ static void canvas_f(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { for (g = x->gl_list; g2 = g->g_next; g = g2) ; - //fprintf(stderr,"same canvas .x%lx .x%lx\n", (t_int)g, (t_int)x); + //fprintf(stderr,"same canvas .x%zx .x%zx\n", (t_int)g, (t_int)x); } if ((ob = pd_checkobject(&g->g_pd)) || pd_class(&g->g_pd) == canvas_class) { @@ -2330,7 +2330,7 @@ void canvasgop_draw_move(t_canvas *x, int doit) //delete the earlier GOP window so that when dragging //there is only one GOP window present on parent /* don't think we need this anymore */ - //sys_vgui(".x%lx.c delete GOP\n", x); + //sys_vgui(".x%zx.c delete GOP\n", x); //redraw the GOP canvas_setgraph(x, x->gl_isgraph+2*x->gl_hidetext, 0); diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 7fd76c20b..aaf73271e 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -128,7 +128,7 @@ void canvas_raise_all_cords (t_canvas *x) { just insert all gobjs (and scalars) before the first patch cord. This way we don't have to constantly raise all the patch cords above everything else. */ - //sys_vgui(".x%lx.c raise all_cords\n", x); + //sys_vgui(".x%zx.c raise all_cords\n", x); } static void canvas_enteritem (t_canvas *x, int xpos, int ypos, const char *tag) { @@ -172,7 +172,7 @@ static void canvas_nlet_conf (t_canvas *x, int type) { } void canvas_getscroll (t_canvas *x) { - //sys_vgui("pdtk_canvas_getscroll .x%lx.c\n",(long)x); + //sys_vgui("pdtk_canvas_getscroll .x%zx.c\n",(long)x); gui_vmess("gui_canvas_get_overriding_scroll", "x", x); } @@ -258,7 +258,7 @@ int gobj_shouldvis(t_gobj *x, struct _glist *glist) /* return true if the text box should be drawn. We don't show text boxes inside graphs---except comments, if we're doing the new (goprect) style. */ - //fprintf(stderr,"pd_checkobject %lx\n", x); + //fprintf(stderr,"pd_checkobject %zx\n", x); /*fprintf(stderr,"pd_checkobject %d %d %d %d %d %d %d\n", glist->gl_havewindow, (ob->te_pd != canvas_class ? 1:0), @@ -314,7 +314,7 @@ int canvas_restore_original_position(t_glist *x, t_gobj *y, const char* objtag, int dir) { /* we do this instead to save us costly redraw of the canvas */ - //fprintf(stderr,"canvas_restore_original_position %lx %lx %s %d\n", + //fprintf(stderr,"canvas_restore_original_position %zx %zx %s %d\n", // (t_int)x, (t_int)y, objtag, dir); int ret = 0; // we only do this if we are not embedded inside gop, otherwise @@ -433,7 +433,7 @@ void glist_selectline(t_glist *x, t_outconnect *oc, int index1, x->gl_editor->e_selectline_index2 = index2; x->gl_editor->e_selectline_inno = inno; x->gl_editor->e_selectline_tag = oc; - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_select_line", "xs", x, tagbuf); c_selection = x; canvas_draw_gop_resize_hooks(x); @@ -453,8 +453,8 @@ void glist_deselectline(t_glist *x) oc = linetraverser_next(&t); } while (oc && oc != x->gl_editor->e_selectline_tag); canvas_draw_gop_resize_hooks(x); - sprintf(tagbuf, "l%lx", - (long unsigned int)x->gl_editor->e_selectline_tag); + sprintf(tagbuf, "l%zx", + (t_int)x->gl_editor->e_selectline_tag); gui_vmess("gui_canvas_deselect_line", "xs", x, tagbuf); } } @@ -473,7 +473,7 @@ int glist_isselected(t_glist *x, t_gobj *y) /* call this for unselected objects only */ void glist_select(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_select c_selection=%lx x=%lx\n", + //fprintf(stderr,"glist_select c_selection=%zx x=%zx\n", // (t_int)c_selection, (t_int)x); if (x->gl_editor) { @@ -509,7 +509,7 @@ void glist_select(t_glist *x, t_gobj *y) c_selection = x; /* Not sure if this is still needed */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 1\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 1\n", x); canvas_draw_gop_resize_hooks(x); } //fprintf(stderr,"select done\n"); @@ -611,7 +611,7 @@ void glist_deselect(t_glist *x, t_gobj *y) canvas_resume_dsp(1); /* Not sure if this is still needed */ //if (!x->gl_editor->e_selection) - // sys_vgui("pdtk_canvas_update_edit_menu .x%lx 0\n", x); + // sys_vgui("pdtk_canvas_update_edit_menu .x%zx 0\n", x); canvas_draw_gop_resize_hooks(x); } //reenter = 0; @@ -821,7 +821,7 @@ void canvas_disconnect(t_canvas *x, if (srcno == index1 && t.tr_outno == outno && sinkno == index2 && t.tr_inno == inno) { - sprintf(tagbuf, "l%lx", (long unsigned int)oc); + sprintf(tagbuf, "l%zx", (t_int)oc); gui_vmess("gui_canvas_delete_line", "xs", x, tagbuf); // jsarlo @@ -1770,7 +1770,7 @@ void canvas_undo_canvas_apply(t_canvas *x, void *z, int action) t_int properties = gfxstub_haveproperties((void *)x); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey(x); } @@ -1853,31 +1853,31 @@ void canvas_undo_canvas_apply(t_canvas *x, void *z, int action) //update the properties with the previous window properties /*t_int properties = gfxstub_haveproperties((void *)x); if (properties) { - sys_vgui("pdtk_canvas_dialog_undo_update .gfxstub%lx %d %d\n", + sys_vgui("pdtk_canvas_dialog_undo_update .gfxstub%zx %d %d\n", properties, x->gl_isgraph, x->gl_hidetext); - sys_vgui(".gfxstub%lx.xscale.entry delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry1 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xscale.entry delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry1 insert 0 %d\n", properties, x->gl_x1); - sys_vgui(".gfxstub%lx.yrange.entry1 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry1 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry1 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry1 insert 0 %d\n", properties, x->gl_y1); - sys_vgui(".gfxstub%lx.xrange.entry2 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry2 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry2 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry2 insert 0 %d\n", properties, x->gl_x2); - sys_vgui(".gfxstub%lx.yrange.entry2 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry2 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry2 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry2 insert 0 %d\n", properties, x->gl_y2); - sys_vgui(".gfxstub%lx.xrange.entry3 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry3 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry3 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry3 insert 0 %d\n", properties, x->gl_pixwidth); - sys_vgui(".gfxstub%lx.yrange.entry3 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry3 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry3 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry3 insert 0 %d\n", properties, x->gl_pixheight); - sys_vgui(".gfxstub%lx.xrange.entry4 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.xrange.entry4 insert 0 %d\n", + sys_vgui(".gfxstub%zx.xrange.entry4 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.xrange.entry4 insert 0 %d\n", properties, x->gl_xmargin); - sys_vgui(".gfxstub%lx.yrange.entry4 delete 0 end\n", properties); - sys_vgui(".gfxstub%lx.yrange.entry4 insert 0 %d\n", + sys_vgui(".gfxstub%zx.yrange.entry4 delete 0 end\n", properties); + sys_vgui(".gfxstub%zx.yrange.entry4 insert 0 %d\n", properties, x->gl_ymargin); }*/ @@ -1970,7 +1970,7 @@ void canvas_undo_create(t_canvas *x, void *z, int action) t_undo_create *buf = z; t_gobj *y; - //fprintf(stderr,"canvas = %lx buf->u_index = %d\n", + //fprintf(stderr,"canvas = %zx buf->u_index = %d\n", // (t_int)x, buf->u_index); if (action == UNDO_UNDO) @@ -2059,7 +2059,7 @@ void canvas_undo_recreate(t_canvas *x, void *z, int action) else if (action == UNDO_REDO) y = glist_nth(x, buf->u_index); - //fprintf(stderr,"canvas = %lx buf->u_index = %d\n", + //fprintf(stderr,"canvas = %zx buf->u_index = %d\n", // (t_int)x, buf->u_index); if (action == UNDO_UNDO || action == UNDO_REDO) @@ -2151,14 +2151,14 @@ void canvas_undo_font(t_canvas *x, void *z, int action) if (properties) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", (long unsigned int)properties); + sprintf(tagbuf, ".gfxstub%zx", (t_int)properties); gui_vmess("gui_font_dialog_change_size", "si", tagbuf, u_f->font); } else { - //sys_vgui("dofont_apply .x%lx %d 1\n", x2, u_f->font); + //sys_vgui("dofont_apply .x%zx %d 1\n", x2, u_f->font); /* In pd.tk there is a global variable holding the last font size. So our dataflow is: 1) Pd -> GUI dofont_apply as above @@ -2601,7 +2601,7 @@ static t_editor *editor_new(t_glist *owner) x->e_connectbuf = binbuf_new(); x->e_deleted = binbuf_new(); x->e_glist = owner; - sprintf(buf, "x%.6lx", (t_int)owner); + sprintf(buf, "x%.6zx", (t_int)owner); x->e_guiconnect = guiconnect_new(&owner->gl_pd, gensym(buf)); x->gl_magic_glass = magicGlass_new(owner); x->canvas_cnct_inlet_tag[0] = 0; @@ -2630,7 +2630,7 @@ static void editor_free(t_editor *x, t_glist *y) sub-glists, as long as they aren't toplevels. */ void canvas_create_editor(t_glist *x) { - //fprintf(stderr,"create_editor %lx\n", x); + //fprintf(stderr,"create_editor %zx\n", x); t_gobj *y; t_object *ob; if (!x->gl_editor) @@ -2644,7 +2644,7 @@ void canvas_create_editor(t_glist *x) void canvas_destroy_editor(t_glist *x) { - //fprintf(stderr,"destroy_editor %lx\n", x); + //fprintf(stderr,"destroy_editor %zx\n", x); t_gobj *y; t_object *ob; glist_noselect(x); @@ -2688,7 +2688,7 @@ void canvas_init_menu(t_canvas *x) void canvas_vis(t_canvas *x, t_floatarg f) { - //fprintf(stderr,"canvas_vis .x%lx %f\n", (t_int)x, f); + //fprintf(stderr,"canvas_vis .x%zx %f\n", (t_int)x, f); char geobuf[MAXPDSTRING]; char argsbuf[MAXPDSTRING]; sprintf(geobuf, "+%d+%d", @@ -2707,9 +2707,9 @@ void canvas_vis(t_canvas *x, t_floatarg f) if (x->gl_editor && x->gl_havewindow && glist_isvisible(x)) { /* just put us in front */ //fprintf(stderr,"existing\n"); - //sys_vgui("raise .x%lx\n", x); - //sys_vgui("focus .x%lx.c\n", x); - //sys_vgui("wm deiconify .x%lx\n", x); + //sys_vgui("raise .x%zx\n", x); + //sys_vgui("focus .x%zx.c\n", x); + //sys_vgui("wm deiconify .x%zx\n", x); gui_vmess("gui_raise_window", "x", x); } else @@ -2737,7 +2737,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) } else { - sys_vgui("focus .x%lx\n", (t_int)x); + sys_vgui("focus .x%zx\n", (t_int)x); } } else @@ -2768,8 +2768,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) /* It looks like this font size call is no longer needed, but I'm not sure why it was needed in the first place... */ - //sys_vgui("pdtk_canvas_set_font .x%lx %d\n", x, x->gl_font); - + //sys_vgui("pdtk_canvas_set_font .x%zx %d\n", x, x->gl_font); //canvas_reflecttitle(x); x->gl_havewindow = 1; @@ -2816,7 +2815,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) properties = gfxstub_haveproperties((void *)g); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey((void *)g); } g = g->g_next; @@ -2829,7 +2828,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) properties = gfxstub_haveproperties((void *)x); if (properties) { - //sys_vgui("destroy .gfxstub%lx\n", properties); + //sys_vgui("destroy .gfxstub%zx\n", properties); gfxstub_deleteforkey((void *)x); } } @@ -3238,7 +3237,7 @@ void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float ypos) { //fprintf(stderr,"x->gl_edit=%d\n", x->gl_edit); - //fprintf(stderr,"canvas_done_pupup %lx\n", (t_int)x); + //fprintf(stderr,"canvas_done_pupup %zx\n", (t_int)x); char namebuf[FILENAME_MAX]; t_gobj *y=NULL, *oldy=NULL, *oldy_prev=NULL, *oldy_next=NULL, *y_begin, *y_end=NULL; @@ -3976,9 +3975,9 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, canvas_check_nlet_highlights(x); } //toggle_moving = 1; - //sys_vgui("pdtk_update_xy_tooltip .x%lx %d %d\n", + //sys_vgui("pdtk_update_xy_tooltip .x%zx %d %d\n", // x, (int)xpos, (int)ypos); - //sys_vgui("pdtk_toggle_xy_tooltip .x%lx %d\n", x, 1); + //sys_vgui("pdtk_toggle_xy_tooltip .x%zx %d\n", x, 1); x->gl_editor->e_onmotion = MA_MOVE; /* once the code for creating a new object looks sane we'll leave rendering the tooltips to the GUI. */ @@ -4323,7 +4322,7 @@ void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, ymax = 20; } if (yoff > ymax) yoff = ymax; - sprintf(tagbuf, "l%lx", (long unsigned int)tag); + sprintf(tagbuf, "l%zx", (t_int)tag); gui_vmess("gui_canvas_line", "xssiiiiiiiiiii", x, tagbuf, @@ -4373,7 +4372,7 @@ void canvas_updateconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, if (yoff > ymax) yoff = ymax; if (tag) { - sprintf(cord_tag, "l%lx", (long unsigned int)tag); + sprintf(cord_tag, "l%zx", (t_int)tag); gui_vmess("gui_canvas_update_line", "xsiiiii", x, cord_tag, @@ -5013,7 +5012,7 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) { canvas_updateconnection(x, x->gl_editor->e_xwas, x->gl_editor->e_ywas, xpos, ypos, 0); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 0\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 0\n", x); /* tried canvas_getscroll here instead, but it doesn't seem to add much value. Can revisit later if need be... */ //canvas_getscroll(x); @@ -5178,7 +5177,7 @@ void canvas_mouseup(t_canvas *x, { //if (toggle_moving == 1) { // toggle_moving = 0; - // sys_vgui("pdtk_toggle_xy_tooltip .x%lx %d\n", x, 0); + // sys_vgui("pdtk_toggle_xy_tooltip .x%zx %d\n", x, 0); //} int xpos = fxpos, ypos = fypos, which = fwhich; /* post("mouseup %d %d %d", xpos, ypos, which); */ @@ -5211,7 +5210,7 @@ void canvas_mouseup(t_canvas *x, else if (x->gl_editor->e_onmotion == MA_SCROLL) { /* Let's try to do this exclusively in the GUI... */ - //sys_vgui("pdtk_canvas_scroll_xy_click .x%lx %d %d 0\n", + //sys_vgui("pdtk_canvas_scroll_xy_click .x%zx %d %d 0\n", // (t_int)x, (int)fxpos, (int)fypos); x->gl_editor->e_onmotion = MA_NONE; canvas_setcursor(x, CURSOR_EDITMODE_NOTHING); @@ -5275,7 +5274,7 @@ void canvas_mousedown_middle(t_canvas *x, t_floatarg xpos, t_floatarg ypos, } else { - //sys_vgui("pdtk_canvas_scroll_xy_click .x%lx %d %d 3\n", + //sys_vgui("pdtk_canvas_scroll_xy_click .x%zx %d %d 3\n", // (t_int)x, (int)xpos, (int)ypos); x->gl_editor->e_onmotion = MA_SCROLL; canvas_setcursor(x, CURSOR_SCROLL); @@ -5666,12 +5665,12 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, x->gl_editor->e_xnew = xpos; x->gl_editor->e_ynew = ypos; // scrollbar_update(x); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 20\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 20\n", x); } else if (x->gl_editor->e_onmotion == MA_REGION) { canvas_doregion(x, xpos, ypos, 0); - //sys_vgui("pdtk_check_scroll_on_motion .x%lx.c 0\n", x); + //sys_vgui("pdtk_check_scroll_on_motion .x%zx.c 0\n", x); /* This turns out not to be very useful so it's commented. Can revisit later... */ //canvas_getscroll(x); @@ -5716,7 +5715,7 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, // object vis function should check if the object is still // selected, so as to draw the outline in the right color // it should also tag all aspects with selected tag - // fprintf(stderr,"MA_RESIZE gobj=%lx\n", y1); + // fprintf(stderr,"MA_RESIZE gobj=%zx\n", y1); canvas_dirty(x, 1); } else if (ob && ob->ob_pd == canvas_class) @@ -5762,7 +5761,7 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, // (double)xpos, (double)ypos, 0, (double)mod); } //if (toggle_moving == 1) { - // sys_vgui("pdtk_update_xy_tooltip .x%lx %d %d\n", + // sys_vgui("pdtk_update_xy_tooltip .x%zx %d %d\n", // x, (int)xpos, (int)ypos); //} x->gl_editor->e_lastmoved = 1; @@ -5814,7 +5813,7 @@ void canvas_print(t_canvas *x, t_symbol *s) 3) Replace with an svg export menu item 4) Nothing */ - //sys_vgui(".x%lx.c postscript -file %s\n", x, + //sys_vgui(".x%zx.c postscript -file %s\n", x, // *s->s_name ? s->s_name : "x.ps"); } @@ -5882,7 +5881,7 @@ void glob_verifyquit(void *dummy, t_floatarg f) 3); } //canvas_vis(g2, 1); - //sys_vgui("pdtk_canvas_menuclose .x%lx {.x%lx menuclose 3;\n}\n", + //sys_vgui("pdtk_canvas_menuclose .x%zx {.x%zx menuclose 3;\n}\n", // canvas_getrootfor(g2), g2); return; } @@ -5914,7 +5913,7 @@ void glob_verifyquit(void *dummy, t_floatarg f) */ void canvas_menuclose(t_canvas *x, t_floatarg fforce) { - //fprintf(stderr,"canvas_menuclose %lx %f\n", (t_int)x, fforce); + //fprintf(stderr,"canvas_menuclose %zx %f\n", (t_int)x, fforce); int force = fforce; t_glist *g; if ((x->gl_owner || x->gl_isclone) && (force == 0 || force == 1)) @@ -5961,8 +5960,8 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) } else if (force == 1) { - //sys_vgui("pd {.x%lx menuclose -1;}\n", x); - //sys_vgui("menu_close .x%lx\n", x); + //sys_vgui("pd {.x%zx menuclose -1;}\n", x); + //sys_vgui("menu_close .x%zx\n", x); //sys_queuegui(x, x, canvas_dofree); //canvas_vis(x, 0); //canvas_free(x); @@ -6004,12 +6003,12 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) g, 2); } - //sys_vgui("pdtk_canvas_menuclose .x%lx {.x%lx menuclose 2;\n}\n", + //sys_vgui("pdtk_canvas_menuclose .x%zx {.x%zx menuclose 2;\n}\n", // canvas_getrootfor(x), g); return; } else pd_free(&x->gl_pd); - //sys_vgui("pd {.x%lx menuclose -1;}\n", x); + //sys_vgui("pd {.x%zx menuclose -1;}\n", x); //sys_queuegui(x, x, canvas_dofree); //clock_delay(x->gl_destroy, 0); } @@ -6447,14 +6446,14 @@ static void canvas_copy(t_canvas *x) /* Ok, this makes no sense-- if we return above when there's no e_selection, then how could the following possibly be true? */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 0\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 0\n", x); } else { /* Still not exactly sure what this is doing. If it's just disabling menu items related to the clipboard I think we can do without it. */ - //sys_vgui("pdtk_canvas_update_edit_menu .x%lx 1\n", x); + //sys_vgui("pdtk_canvas_update_edit_menu .x%zx 1\n", x); } paste_xyoffset = 1; if (x->gl_editor->e_textedfor) @@ -6543,7 +6542,7 @@ static void canvas_doclear(t_canvas *x) /* now destroy the object */ glist_delete(x, y); #if 0 - if (y2) post("cut 5 %lx %lx", y2, y2->g_next); + if (y2) post("cut 5 %zx %zx", y2, y2->g_next); else post("cut 6"); #endif goto next; @@ -7005,7 +7004,7 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b) // hardwired stretchval and whichstretch // until we figure out proper resizing canvas_dofont(x, copiedfont, 1, 1); - //sys_vgui("pdtk_canvas_checkgeometry .x%lx\n", x); + //sys_vgui("pdtk_canvas_checkgeometry .x%zx\n", x); canvas_redraw(x); } } @@ -7413,8 +7412,8 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno, { //fprintf(stderr,"draw line\n"); canvas_drawconnection(x, 0, 0, 0, 0, (t_int)oc, obj_issignaloutlet(objsrc, outno)); - /*sys_vgui(".x%lx.c create polyline %d %d %d %d -strokewidth %s " - "-stroke %s -tags {l%lx all_cords}\n", + /*sys_vgui(".x%zx.c create polyline %d %d %d %d -strokewidth %s " + "-stroke %s -tags {l%zx all_cords}\n", glist_getcanvas(x), 0, 0, 0, 0, (obj_issignaloutlet(objsrc, outno) ? "$pd_colors(signal_cord_width)" : @@ -8014,7 +8013,7 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease) canvas_setcursor(x, CURSOR_RUNMODE_NOTHING); /* Don't need this anymore, as we can control comment appearance with CSS. */ - //sys_vgui(".x%lx.c delete commentbar\n", glist_getcanvas(x)); + //sys_vgui(".x%zx.c delete commentbar\n", glist_getcanvas(x)); // jsarlo if (x->gl_editor->canvas_cnct_inlet_tag[0] != 0) { @@ -8089,7 +8088,7 @@ void canvas_tooltips(t_canvas *x, t_floatarg fyesplease) tooltips = 0; tooltip_erase(x); } - //sys_vgui("pdtk_canvas_tooltips .x%lx %d\n", + //sys_vgui("pdtk_canvas_tooltips .x%zx %d\n", // x, tooltips); } @@ -8114,7 +8113,7 @@ static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, ny1 = y1 * yresize + 0.5; if (pd_class(&y->g_pd) != scalar_class) { - //fprintf(stderr,"dofont gobj displace %lx %d %d %d %d : " + //fprintf(stderr,"dofont gobj displace %zx %d %d %d %d : " // "%f %f : %d %d\n", // y, x1, x2, y1, y2, xresize, yresize, nx1, ny1); gobj_displace(y, x, nx1-x1, ny1-y1); @@ -8123,7 +8122,7 @@ static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, } if (glist_isvisible(x)) { - //fprintf(stderr,"glist_redraw %lx\n", x); + //fprintf(stderr,"glist_redraw %zx\n", x); if (x->gl_editor && magicGlass_isOn(x->gl_editor->gl_magic_glass)) magicGlass_hide(x->gl_editor->gl_magic_glass); glist_redraw(x); @@ -8226,7 +8225,7 @@ static void canvas_enterobj(t_canvas *x, t_symbol *item, t_floatarg xpos, //helpname = g->g_pd->c_helpname; //dir = g->g_pd->c_externdir; } - //sys_vgui("pdtk_gettip .x%lx.c %s %d " + //sys_vgui("pdtk_gettip .x%zx.c %s %d " //"[list %s] [list %s] [list %s]\n", //x, item->s_name, (int)xletno, //name->s_name, helpname->s_name, dir->s_name); @@ -8242,7 +8241,7 @@ static void canvas_tip(t_canvas *x, t_symbol *s, int argc, t_atom *argv) error("canvas_tip: bad argument"); else { - //sys_vgui("pdtk_tip .x%lx.c 1", x); + //sys_vgui("pdtk_tip .x%zx.c 1", x); //t_atom *at = argv; int i; for (i=0; i<argc; i++) diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index dfc797952..484dd2386 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -135,7 +135,7 @@ void glist_update_redrect(t_glist *x) void glist_add(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_add %lx %d\n", (t_int)x, (x->gl_editor ? 1 : 0)); + //fprintf(stderr,"glist_add %zx %d\n", (t_int)x, (x->gl_editor ? 1 : 0)); t_object *ob; y->g_next = 0; int index = 0; @@ -205,7 +205,7 @@ void canvas_closebang(t_canvas *x); /* delete an object from a glist and free it */ void glist_delete(t_glist *x, t_gobj *y) { - //fprintf(stderr,"glist_delete y=%lx x=%lx glist_getcanvas=%lx\n", y, x, glist_getcanvas(x)); + //fprintf(stderr,"glist_delete y=%zx x=%zx glist_getcanvas=%zx\n", y, x, glist_getcanvas(x)); if (x->gl_list) { //fprintf(stderr,"glist_delete YES\n"); @@ -255,7 +255,7 @@ void glist_delete(t_glist *x, t_gobj *y) if (gl->gl_isgraph) { char tag[80]; - //sprintf(tag, "graph%lx", (t_int)gl); + //sprintf(tag, "graph%zx", (t_int)gl); //t_glist *yy = (t_glist *)y; sprintf(tag, "%s", rtext_gettag(glist_findrtext(x, &gl->gl_obj))); @@ -284,7 +284,7 @@ void glist_delete(t_glist *x, t_gobj *y) } if (glist_isvisible(canvas)) { - //fprintf(stderr,"...deleting %lx %lx\n", x, glist_getcanvas(x)); + //fprintf(stderr,"...deleting %zx %zx\n", x, glist_getcanvas(x)); gobj_vis(y, x, 0); } if (x->gl_editor && (ob = pd_checkobject(&y->g_pd))) @@ -386,7 +386,7 @@ t_canvas *glist_getcanvas(t_glist *x) //fprintf(stderr,"glist_getcanvas\n"); while (x->gl_owner && !x->gl_havewindow && x->gl_isgraph) { - //fprintf(stderr,"x=%lx x->gl_owner=%d x->gl_havewindow=%d " + //fprintf(stderr,"x=%zx x->gl_owner=%d x->gl_havewindow=%d " // "x->gl_isgraph=%d gobj_shouldvis=%d\n", // x, (x->gl_owner ? 1:0), x->gl_havewindow, x->gl_isgraph, // gobj_shouldvis(&x->gl_gobj, x->gl_owner)); @@ -491,7 +491,7 @@ void glist_sort(t_glist *x) t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *s) { - //fprintf(stderr,"canvas_addinlet %d %lx %d\n", x->gl_loading, x->gl_owner, glist_isvisible(x->gl_owner)); + //fprintf(stderr,"canvas_addinlet %d %zx %d\n", x->gl_loading, x->gl_owner, glist_isvisible(x->gl_owner)); t_inlet *ip = inlet_new(&x->gl_obj, who, s, 0); if (!x->gl_loading && x->gl_owner && glist_isvisible(x->gl_owner)) { @@ -563,7 +563,7 @@ void canvas_resortinlets(t_canvas *x) { canvas_fixlinesfor(x->gl_owner, &x->gl_obj); //fprintf(stderr,"good place to fix redrawing of inlets " - // ".x%lx owner=.x%lx %d (parent)%d\n", + // ".x%zx owner=.x%zx %d (parent)%d\n", // x, x->gl_owner, x->gl_loading, x->gl_owner->gl_loading); /* @@ -980,7 +980,7 @@ void glist_redraw(t_glist *x) linetraverser_start(&t, x); while (oc = linetraverser_next(&t)) canvas_updateconnection(glist_getcanvas(x), t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, (t_int)oc); - //sys_vgui(".x%lx.c coords l%lx %d %d %d %d\n", + //sys_vgui(".x%zx.c coords l%zx %d %d %d %d\n", // glist_getcanvas(x), oc, // t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2); canvas_drawredrect(x, 0); @@ -1017,10 +1017,10 @@ t_symbol *garray_getlabelcolor(t_garray *x); static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) { t_glist *x = (t_glist *)gr; - //fprintf(stderr,"graph vis canvas=%lx gobj=%lx %d\n", + //fprintf(stderr,"graph vis canvas=%zx gobj=%zx %d\n", // (t_int)parent_glist, (t_int)gr, vis); - //fprintf(stderr, "graph_vis gr=.x%lx parent_glist=.x%lx " - // "glist_getcanvas(x->gl_owner)=.x%lx vis=%d\n", + //fprintf(stderr, "graph_vis gr=.x%zx parent_glist=.x%zx " + // "glist_getcanvas(x->gl_owner)=.x%zx vis=%d\n", // (t_int)gr, (t_int)parent_glist, // (t_int)glist_getcanvas(x->gl_owner), vis); char tag[50]; @@ -1051,7 +1051,7 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) // tgt = parent_glist; // exception = 1; //} - //fprintf(stderr,"tgt=.x%lx %d\n", (t_int)tgt, exception); + //fprintf(stderr,"tgt=.x%zx %d\n", (t_int)tgt, exception); if (vis & gobj_shouldvis(gr, parent_glist)) { @@ -1082,8 +1082,8 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis) if (!vis) rtext_erase(glist_findrtext(parent_glist, &x->gl_obj)); - //sprintf(tag, "graph%lx", (t_int)x); - //fprintf(stderr, "gettag=%s, tag=graph%lx\n", + //sprintf(tag, "graph%zx", (t_int)x); + //fprintf(stderr, "gettag=%s, tag=graph%zx\n", // rtext_gettag(glist_findrtext(parent_glist, &x->gl_obj)),(t_int)x); /* if we look like a graph but have been moved to a toplevel, just show the bounding rectangle */ @@ -1518,9 +1518,9 @@ static void graph_displace(t_gobj *z, t_glist *glist, int dx, int dy) sprintf(tag, "%s", rtext_gettag( glist_findrtext((x->gl_owner ? x->gl_owner: x), &x->gl_obj))); - sys_vgui(".x%lx.c move %s %d %d\n", + sys_vgui(".x%zx.c move %s %d %d\n", glist_getcanvas(x->gl_owner), tag, dx, dy); - sys_vgui(".x%lx.c move %sR %d %d\n", + sys_vgui(".x%zx.c move %sR %d %d\n", glist_getcanvas(x->gl_owner), tag, dx, dy);*/ if (!do_not_redraw) { @@ -1592,7 +1592,7 @@ static void graph_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) static void graph_select(t_gobj *z, t_glist *glist, int state) { - //fprintf(stderr,"graph_select .x%lx .x%lx %d...\n", + //fprintf(stderr,"graph_select .x%zx .x%zx %d...\n", // (t_int)z, (t_int)glist, state); t_glist *x = (t_glist *)z; if (!x->gl_isgraph) @@ -1600,7 +1600,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) else //if(glist_istoplevel(glist)) { //fprintf(stderr,"...yes\n"); - //fprintf(stderr,"%lx %lx %lx\n", glist_getcanvas(glist), glist, x); + //fprintf(stderr,"%zx %zx %zx\n", glist_getcanvas(glist), glist, x); t_rtext *y = glist_findrtext(glist, &x->gl_obj); if (canvas_showtext(x)) { @@ -1645,7 +1645,7 @@ static void graph_select(t_gobj *z, t_glist *glist, int state) } // Don't yet understand the purpose of this call, so not deleting // it just yet... - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %s %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %s %d\n", // canvas, rtext_gettag(glist_findrtext(glist, &x->gl_obj)), state); } } @@ -1669,7 +1669,7 @@ static void graph_delete(t_gobj *z, t_glist *glist) while (y = x->gl_list) glist_delete(x, y); #if 0 /* I think this was just wrong. */ if (glist_isvisible(x)) - sys_vgui(".x%lx.c delete graph%lx\n", glist_getcanvas(glist), x); + sys_vgui(".x%zx.c delete graph%zx\n", glist_getcanvas(glist), x); #endif } } @@ -1740,7 +1740,7 @@ static int graph_click(t_gobj *z, struct _glist *glist, } if (!doit) { - //fprintf(stderr," not clicking %lx %d\n", + //fprintf(stderr," not clicking %zx %d\n", // (t_int)clickme, clickreturned); if (clickme != NULL) { diff --git a/pd/src/g_io.c b/pd/src/g_io.c index eee1af66c..6b1184241 100644 --- a/pd/src/g_io.c +++ b/pd/src/g_io.c @@ -106,8 +106,8 @@ t_int *vinlet_perform(t_int *w) int n = (int)(w[3]); t_float *in = x->x_read; #if 0 - if (tot < 5) post("-in %lx out %lx n %d", in, out, n); - if (tot < 5) post("-buf %lx endbuf %lx", x->x_buf, x->x_endbuf); + if (tot < 5) post("-in %zx out %zx n %d", in, out, n); + if (tot < 5) post("-buf %zx endbuf %zx", x->x_buf, x->x_endbuf); if (tot < 5) post("in[0] %f in[1] %f in[2] %f", in[0], in[1], in[2]); #endif while (n--) *out++ = *in++; @@ -162,7 +162,7 @@ t_int *vinlet_doprolog(t_int *w) while (nshift--) *f1++ = *f2++; } #if 0 - if (tot < 5) post("in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("in %zx out %zx n %zx", in, out, n), tot++; if (tot < 5) post("in[0] %f in[1] %f in[2] %f", in[0], in[1], in[2]); #endif @@ -396,8 +396,8 @@ t_int *voutlet_perform(t_int *w) int n = (int)(w[3]); t_sample *out = x->x_write, *outwas = out; #if 0 - if (tot < 5) post("-in %lx out %lx n %d", in, out, n); - if (tot < 5) post("-buf %lx endbuf %lx", x->x_buf, x->x_endbuf); + if (tot < 5) post("-in %zx out %zx n %d", in, out, n); + if (tot < 5) post("-buf %zx endbuf %zx", x->x_buf, x->x_endbuf); #endif while (n--) { @@ -422,7 +422,7 @@ static t_int *voutlet_doepilog(t_int *w) out = x->x_updown.s_vec; #if 0 - if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("outlet in %zx out %zx n %zx", in, out, n), tot++; #endif for (; n--; in++) *out++ = *in, *in = 0; if (in == x->x_endbuf) in = x->x_buf; @@ -438,7 +438,7 @@ static t_int *voutlet_doepilog_resampling(t_int *w) t_sample *out = x->x_updown.s_vec; #if 0 - if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; + if (tot < 5) post("outlet in %zx out %zx n %zx", in, out, n), tot++; #endif for (; n--; in++) *out++ = *in, *in = 0; if (in == x->x_endbuf) in = x->x_buf; diff --git a/pd/src/g_magicglass.c b/pd/src/g_magicglass.c index 999bc55e9..26ccf5247 100644 --- a/pd/src/g_magicglass.c +++ b/pd/src/g_magicglass.c @@ -19,7 +19,7 @@ void magicGlass_clearText(t_magicGlass *x); void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno) { - //fprintf(stderr,"magicglass_bind %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_bind %zx\n", (t_int)x); if (x->x_connectedObj != obj) { if (x->x_connectedObj) @@ -39,7 +39,7 @@ void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno) void magicGlass_unbind(t_magicGlass *x) { - //fprintf(stderr,"magicglass_unbind %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_unbind %zx\n", (t_int)x); if (x->x_connectedObj) { obj_disconnect(x->x_connectedObj, @@ -387,7 +387,7 @@ void *magicGlass_new(t_glist *c) void magicGlass_free(t_magicGlass *x) { - //fprintf(stderr,"magicglass_free %lx\n", (t_int)x); + //fprintf(stderr,"magicglass_free %zx\n", (t_int)x); magicGlass_unbind(x); x->x_dspOn = 0; clock_free(x->x_clearClock); diff --git a/pd/src/g_numbox.c b/pd/src/g_numbox.c index 85c23ec7f..b72c46bc9 100644 --- a/pd/src/g_numbox.c +++ b/pd/src/g_numbox.c @@ -211,8 +211,8 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) k12? */ if (!x->x_hide_frame || x->x_hide_frame == 2) { - //sys_vgui(".x%lx.c create polyline %d %d %d %d %d %d -stroke #%6.6x " - // "-tags {%lxBASE2 x%lx text iemgui}\n", + //sys_vgui(".x%zx.c create polyline %d %d %d %d %d %d -stroke #%6.6x " + // "-tags {%zxBASE2 x%zx text iemgui}\n", // canvas, x1, y1, x1 + half, y1 + half, x1, y2, // x->x_gui.x_fcol, x, x); } @@ -242,7 +242,7 @@ static void my_numbox_draw_move(t_my_numbox *x, t_glist *glist) iemgui_io_draw_move(&x->x_gui); if (!x->x_hide_frame || x->x_hide_frame == 2) { - //sys_vgui(".x%lx.c coords %lxBASE2 %d %d %d %d %d %d\n", + //sys_vgui(".x%zx.c coords %zxBASE2 %d %d %d %d %d %d\n", // canvas, x, x1, y1, x1 + half, y1 + half, x1, y2); } @@ -290,11 +290,11 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist) char bcol[8]; sprintf(bcol, "#%6.6x", x->x_gui.x_bcol); // The logic in these sys_vgui calls is being taken care // of in the gui now... - //sys_vgui(".x%lx.c itemconfigure %lxBASE1 -stroke %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxBASE1 -stroke %s\n", canvas, x, // issel ? selection_color : x->x_hide_frame <= 1 ? "$pd_colors(iemgui_border)" : bcol); - //sys_vgui(".x%lx.c itemconfigure %lxBASE2 -stroke %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxBASE2 -stroke %s\n", canvas, x, // issel ? selection_color : fcol); - //sys_vgui(".x%lx.c itemconfigure %lxNUMBER -fill %s\n", canvas, x, + //sys_vgui(".x%zx.c itemconfigure %zxNUMBER -fill %s\n", canvas, x, // issel ? selection_color : fcol); if(issel) scalehandle_draw_select2(&x->x_gui); diff --git a/pd/src/g_radio.c b/pd/src/g_radio.c index 1c119aae8..6ff63f9cd 100644 --- a/pd/src/g_radio.c +++ b/pd/src/g_radio.c @@ -115,7 +115,7 @@ void radio_draw_config(t_radio *x, t_glist *glist) iemgui_base_draw_config(&x->x_gui); for (i=0; i<n; i++) { - //sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -stroke #%6.6x\n", + //sys_vgui(".x%zx.c itemconfigure %zxBUT%d -fill #%6.6x -stroke #%6.6x\n", // canvas, x, i, // (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol, // (x->x_on==i) ? x->x_gui.x_fcol : x->x_gui.x_bcol); diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index 89e25745f..24401204f 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -65,7 +65,7 @@ t_rtext *rtext_new(t_glist *glist, t_text *who) // supposed to be there (they don't belong to that canvas). See // in pd.tk pdtk_select_all_gop_widgets function and how it affects // draw data structures that are displayed via gop (Ico 20140831) - sprintf(x->x_tag, ".x%lx.t%lx", (t_int)glist_getcanvas(x->x_glist), + sprintf(x->x_tag, ".x%zx.t%zx", (t_int)glist_getcanvas(x->x_glist), (t_int)x); return (x); } @@ -361,7 +361,7 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, } if (action == SEND_FIRST) { - //fprintf(stderr,"send_first rtext=%lx t_text=%lx\n", x, x->x_text); + //fprintf(stderr,"send_first rtext=%zx t_text=%zx\n", x, x->x_text); gui_vmess("gui_text_new", "xssiiisi", canvas, x->x_tag, rtext_gettype(x)->s_name, glist_isselected(x->x_glist, ((t_gobj*)x->x_text)), @@ -394,19 +394,19 @@ static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, { if (selend_b > selstart_b) { - //sys_vgui(".x%lx.c select from %s %d\n", canvas, + //sys_vgui(".x%zx.c select from %s %d\n", canvas, // x->x_tag, u8_charnum(tempbuf, selstart_b)); - //sys_vgui(".x%lx.c select to %s %d\n", canvas, + //sys_vgui(".x%zx.c select to %s %d\n", canvas, // x->x_tag, u8_charnum(tempbuf, selend_b) // + (sys_oldtclversion ? 0 : -1)); - //sys_vgui(".x%lx.c focus \"\"\n", canvas); + //sys_vgui(".x%zx.c focus \"\"\n", canvas); } else { - //sys_vgui(".x%lx.c select clear\n", canvas); - //sys_vgui(".x%lx.c icursor %s %d\n", canvas, x->x_tag, + //sys_vgui(".x%zx.c select clear\n", canvas); + //sys_vgui(".x%zx.c icursor %s %d\n", canvas, x->x_tag, // u8_charnum(tempbuf, selstart_b)); - //sys_vgui(".x%lx.c focus %s\n", canvas, x->x_tag); + //sys_vgui(".x%zx.c focus %s\n", canvas, x->x_tag); } } } @@ -524,13 +524,13 @@ void rtext_draw(t_rtext *x) void rtext_erase(t_rtext *x) { //if (x && x->x_glist) - // sys_vgui(".x%lx.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); + // sys_vgui(".x%zx.c delete %s\n", glist_getcanvas(x->x_glist), x->x_tag); } /* Not needed since the rtext gets displaced along with the parent gobj group */ void rtext_displace(t_rtext *x, int dx, int dy) { - //sys_vgui(".x%lx.c move %s %d %d\n", glist_getcanvas(x->x_glist), + //sys_vgui(".x%zx.c move %s %d %d\n", glist_getcanvas(x->x_glist), // x->x_tag, dx, dy); } @@ -541,15 +541,15 @@ void rtext_select(t_rtext *x, int state) //t_glist *glist = x->x_glist; //t_canvas *canvas = glist_getcanvas(glist); //if (glist_istoplevel(glist)) - // sys_vgui(".x%lx.c itemconfigure %s -fill %s\n", canvas, + // sys_vgui(".x%zx.c itemconfigure %s -fill %s\n", canvas, // x->x_tag, (state? "$pd_colors(selection)" : "$pd_colors(text)")); //if (x->x_text->te_pd->c_wb && x->x_text->te_pd->c_wb->w_displacefnwtag) //{ // if (state) - // sys_vgui(".x%lx.c addtag selected withtag %s\n", + // sys_vgui(".x%zx.c addtag selected withtag %s\n", // glist_getcanvas(glist), x->x_tag); // else - // sys_vgui(".x%lx.c dtag %s selected\n", + // sys_vgui(".x%zx.c dtag %s selected\n", // glist_getcanvas(glist), x->x_tag); //} /* Not sure the following is needed anymore either-- commenting it @@ -575,7 +575,7 @@ void rtext_activate(t_rtext *x, int state) //if (state == x->x_active) return; // avoid excess calls if (state) { - //sys_vgui(".x%lx.c focus %s\n", canvas, x->x_tag); + //sys_vgui(".x%zx.c focus %s\n", canvas, x->x_tag); glist->gl_editor->e_textedfor = x; glist->gl_editor->e_textdirty = 0; x->x_selstart = 0; @@ -584,8 +584,8 @@ void rtext_activate(t_rtext *x, int state) } else { - //sys_vgui("selection clear .x%lx.c\n", canvas); - //sys_vgui(".x%lx.c focus \"\"\n", canvas); + //sys_vgui("selection clear .x%zx.c\n", canvas); + //sys_vgui(".x%zx.c focus \"\"\n", canvas); if (glist->gl_editor->e_textedfor == x) glist->gl_editor->e_textedfor = 0; x->x_active = 0; @@ -639,7 +639,7 @@ void rtext_activate(t_rtext *x, int state) null terminated. If this becomes a problem we can revisit it later */ tmpbuf = t_getbytes(x->x_bufsize + 1); - sprintf(tmpbuf, "%.*s", x->x_bufsize, x->x_buf); + sprintf(tmpbuf, "%.*s", (int)x->x_bufsize, x->x_buf); /* in case x_bufsize is 0... */ tmpbuf[x->x_bufsize] = '\0'; gui_vmess("gui_textarea", "xssiiiisiiiii", diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c index 2017535c2..1867a1871 100644 --- a/pd/src/g_scalar.c +++ b/pd/src/g_scalar.c @@ -104,7 +104,7 @@ void word_init(t_word *data, t_template *template, t_gpointer *gp) canvas_resume_dsp(dspstate); s__X.s_thing = boundx; - post("eval'd a canvas with addy x%lx", (long unsigned int) + post("eval'd a canvas with addy x%zx", (t_int) wp->w_list); } else if (type == DT_TEXT) @@ -547,7 +547,7 @@ static void scalar_getrect(t_gobj *z, t_glist *owner, void scalar_drawselectrect(t_scalar *x, t_glist *glist, int state) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)x->sc_vec); //fprintf(stderr,"scalar_drawselecterect%d\n", state); if (state) @@ -611,7 +611,7 @@ void scalar_select(t_gobj *z, t_glist *owner, int state) t_scalar *x = (t_scalar *)z; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)x->sc_vec); t_template *tmpl; t_symbol *templatesym = x->sc_template; @@ -642,7 +642,7 @@ void scalar_select(t_gobj *z, t_glist *owner, int state) gui_vmess("gui_gobj_deselect", "xs", glist_getcanvas(owner), tagbuf); } - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(owner), owner, state); scalar_drawselectrect(x, owner, state); } @@ -699,7 +699,7 @@ static void scalar_displace(t_gobj *z, t_glist *glist, int dx, int dy) */ static void scalar_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) { - //fprintf(stderr,"scalar_displace_withtag %lx %d %d\n", (t_int)z, dx, dy); + //fprintf(stderr,"scalar_displace_withtag %zx %d %d\n", (t_int)z, dx, dy); t_scalar *x = (t_scalar *)z; t_symbol *templatesym = x->sc_template; t_template *template = template_findbyname(templatesym); @@ -789,12 +789,12 @@ static void scalar_group_configure(t_scalar *x, t_glist *owner, { t_gobj *y; char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)gl, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_int)gl, + (t_int)data); char parentbuf[MAXPDSTRING]; - sprintf(parentbuf, "dgroup%lx.%lx", - (long unsigned int)parent, - (long unsigned int)data); + sprintf(parentbuf, "dgroup%zx.%zx", + (t_int)parent, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_grouptogui(gl, template, data); @@ -823,7 +823,7 @@ void scalar_doconfigure(t_gobj *xgobj, t_glist *owner) int vis = glist_isvisible(owner); if (vis) { - //fprintf(stderr,"scalar_vis %d %lx\n", vis, (t_int)z); + //fprintf(stderr,"scalar_vis %d %zx\n", vis, (t_int)z); x->sc_bboxcache = 0; t_template *template = template_findbyname(x->sc_template); @@ -837,7 +837,7 @@ void scalar_doconfigure(t_gobj *xgobj, t_glist *owner) t_float yscale = glist_ytopixels(owner, 1) - glist_ytopixels(owner, 0); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)x->sc_vec); gui_vmess("gui_scalar_configure_gobj", "xsiffffii", glist_getcanvas(owner), tagbuf, @@ -930,11 +930,11 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, if (vis) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)gl, - (long unsigned int)x->sc_vec); + sprintf(tagbuf, "dgroup%zx.%zx", (t_int)gl, + (t_int)x->sc_vec); char parentbuf[MAXPDSTRING]; - sprintf(parentbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)x->sc_vec); + sprintf(parentbuf, "dgroup%zx.%zx", (t_int)parent, + (t_int)x->sc_vec); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, parentbuf, group_gettype(gl)->s_name); @@ -960,20 +960,20 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, /* At present, scalars have a three-level hierarchy in the gui, with two levels accessible by the user from within Pd: - scalar - ".scalar%lx", x->sc_vec + scalar - ".scalar%zx", x->sc_vec | <g> with matrix derived from x/y fields, | gop basexy, and gop scaling values. This group is | not configurable by the user. This means that the | a [draw g] below can ignore basexy and gop junk | when computing the transform matrix. v - dgroup - ".dgroup%lx.%lx", templatecanvas, x->sc_vec + dgroup - ".dgroup%zx.%zx", templatecanvas, x->sc_vec | group used as parent for all the toplevel drawing | commands of the scalar (i.e., the ones located on | the same canvas as the [struct]). Its matrix and | options aren't accessible by the user. v - (draw - ".draw%lx.%lx", (t_draw *ptr), x->sc_vec + (draw - ".draw%zx.%zx", (t_draw *ptr), x->sc_vec | the actual drawing command: rectangle, path, g, etc. or Each has its own matrix and options which can set dgroup with messages to the corresponding [draw] object. @@ -988,10 +988,10 @@ static void scalar_groupvis(t_scalar *x, t_glist *owner, t_template *template, */ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) { - //fprintf(stderr,"scalar_vis %d %lx\n", vis, (t_int)z); + //fprintf(stderr,"scalar_vis %d %zx\n", vis, (t_int)z); t_scalar *x = (t_scalar *)z; char buf[50]; - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_int)x); x->sc_bboxcache = 0; @@ -1011,8 +1011,8 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) don't have a template. Pd Vanilla draws a single pixel to represent them, so later we might want to do a simple shape for them... */ - //sys_vgui(".x%lx.c create prect %d %d %d %d " - // "-tags {blankscalar%lx %s}\n", + //sys_vgui(".x%zx.c create prect %d %d %d %d " + // "-tags {blankscalar%zx %s}\n", // glist_getcanvas(owner), x1-1, y1-1, x1+1, y1+1, x, // (glist_isselected(owner, &x->sc_gobj) ? // "scalar_selected" : "")); @@ -1020,12 +1020,12 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) else { /* No need to delete if we don't draw anything... */ - //sys_vgui(".x%lx.c delete blankscalar%lx\n", + //sys_vgui(".x%zx.c delete blankscalar%zx\n", // glist_getcanvas(owner), x); } return; } - //else sys_vgui(".x%lx.c delete blankscalar%lx\n", + //else sys_vgui(".x%zx.c delete blankscalar%zx\n", // glist_getcanvas(owner), x); if (vis) @@ -1043,7 +1043,7 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) } t_float xscale = ((glist_xtopixels(owner, 1) - glist_xtopixels(owner, 0))); t_float yscale = glist_ytopixels(owner, 1) - glist_ytopixels(owner, 0); - /* we translate the .scalar%lx group to displace it on the tk side. + /* we translate the .scalar%zx group to displace it on the tk side. This is the outermost group for the scalar, something like a poor man's viewport. Also: @@ -1051,10 +1051,10 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) * default fill is supposed to be black. * stroke-linejoin should be "miter", not "round" To fix these, we set the correct fill/stroke/strokelinjoin options - here on the .scalar%lx group. (Notice also that tkpath doesn't + here on the .scalar%zx group. (Notice also that tkpath doesn't understand "None"-- instead we must send an empty symbol.) */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)x->sc_vec); gui_vmess("gui_scalar_new", "xsiffffffii", glist_getcanvas(owner), tagbuf, @@ -1067,9 +1067,9 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) char groupbuf[MAXPDSTRING]; // Quick hack to make gui_scalar_draw_group more general (so we // don't have to tack on "gobj" manually) - sprintf(tagbuf, "scalar%lxgobj", (long unsigned int)x->sc_vec); - sprintf(groupbuf, "dgroup%lx.%lx", (long unsigned int)templatecanvas, - (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zxgobj", (t_int)x->sc_vec); + sprintf(groupbuf, "dgroup%zx.%zx", (t_int)templatecanvas, + (t_int)x->sc_vec); gui_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), groupbuf, tagbuf, "g"); pd_bind(&x->sc_gobj.g_pd, gensym(buf)); @@ -1097,7 +1097,7 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) if (!vis) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "scalar%lx", (long unsigned int)x->sc_vec); + sprintf(tagbuf, "scalar%zx", (t_int)x->sc_vec); gui_vmess("gui_scalar_erase", "xs", glist_getcanvas(owner), tagbuf); if (gensym(buf)->s_thing) @@ -1126,7 +1126,7 @@ static void scalar_doredraw(t_gobj *client, t_glist *glist) //fprintf(stderr,"yes\n"); /* I still don't understand what this does... should probably do some scalar gop tests to see if it is actually needed... */ - //sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n", + //sys_vgui("pdtk_select_all_gop_widgets .x%zx %zx %d\n", // glist_getcanvas(glist), glist, 1); } canvas_getscroll(glist_getcanvas(glist)); diff --git a/pd/src/g_slider.c b/pd/src/g_slider.c index 46f12dd62..49da4691a 100644 --- a/pd/src/g_slider.c +++ b/pd/src/g_slider.c @@ -47,7 +47,7 @@ static void slider_draw_update(t_gobj *client, t_glist *glist) /* the indicator thickens when it's right in the middle... but it's pretty obscure, undocumented, and looks a bit like a bug if you're not expecting it */ - //sys_vgui(".x%lx.c itemconfigure %lxKNOB -strokewidth %d\n", + //sys_vgui(".x%zx.c itemconfigure %zxKNOB -strokewidth %d\n", // canvas, x, 4*x->x_thick+3); } } diff --git a/pd/src/g_template.c b/pd/src/g_template.c index 4bdd67f3c..147a7073a 100644 --- a/pd/src/g_template.c +++ b/pd/src/g_template.c @@ -67,7 +67,7 @@ static int dataslot_matches(t_dataslot *ds1, t_dataslot *ds2, t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv) { t_template *x = (t_template *)pd_new(template_class); - //fprintf(stderr,"template_new %lx\n", x); + //fprintf(stderr,"template_new %zx\n", x); x->t_n = 0; x->t_transformable = 0; x->t_vec = (t_dataslot *)t_getbytes(0); @@ -1460,7 +1460,7 @@ void *svg_new(t_pd *parent, t_symbol *s, int argc, t_atom *argv) // Here we bind the parent object to the addy for // the svg. This way both [group] and [draw] will have // the same binding symbol - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_int)x); pd_bind(parent, gensym(buf)); return (x); @@ -1749,15 +1749,15 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, index = -1; if (x->x_type == gensym("g") || x->x_type == gensym("svg")) { - sprintf(tag, "dgroup%lx.%lx", - (long unsigned int)x->x_parent, - (long unsigned int)data); + sprintf(tag, "dgroup%zx.%zx", + (t_int)x->x_parent, + (t_int)data); } else { - sprintf(tag, "draw%lx.%lx", - (long unsigned int)x->x_parent, - (long unsigned int)data); + sprintf(tag, "draw%zx.%zx", + (t_int)x->x_parent, + (t_int)data); } if (s == gensym("bbox")) *predraw_bbox = 1; @@ -1929,8 +1929,8 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, else if (s == gensym("d")) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)parent, (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)parent, (t_int)data); gui_start_vmess("gui_draw_configure", "xss", glist_getcanvas(c), tagbuf, "d"); /* let's turn off bbox caching so we can recalculate the bbox */ @@ -1998,8 +1998,8 @@ void svg_sendupdate(t_svg *x, t_canvas *c, t_symbol *s, else if (s == gensym("points")) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)parent, (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)parent, (t_int)data); gui_start_vmess("gui_draw_coords", "xss", glist_getcanvas(c), tagbuf, x->x_type->s_name); gui_start_array(); @@ -2174,20 +2174,20 @@ void svg_register_events(t_gobj *z, t_canvas *c, t_scalar *sc, if (pd_class(&z->g_pd) == canvas_class) { svg = (t_svg *)((t_glist *)z)->gl_svg; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_int)z, + (t_int)data); } else if (pd_class(&z->g_pd) == draw_class) { svg = (t_svg *)((t_draw *)z)->x_attr; - sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", (t_int)z, + (t_int)data); } else if (pd_class(&z->g_pd) == drawimage_class) { svg = (t_svg *)((t_drawimage *)z)->x_attr; - sprintf(tagbuf, "draw%lx.%lx", (long unsigned int)z, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", (t_int)z, + (t_int)data); } else /* legacy drawing commands: curve, drawnumber, etc. */ { @@ -4221,19 +4221,19 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", + sprintf(parent_tagbuf, "dgroup%zx.%zx", (in_array ? - (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); gui_s(parent_tagbuf); /* tags - one for this scalar (not sure why the double glist thingy) one for this specific draw item */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_s(tagbuf); gui_end_array(); gui_end_vmess(); @@ -4246,7 +4246,7 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, //glist_noselect(gl); //glist_select(gl, (t_gobj *)glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); @@ -4260,8 +4260,8 @@ static void draw_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, if (n > 1) { char itemtagbuf[MAXPDSTRING]; - sprintf(itemtagbuf, "draw%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(itemtagbuf, "draw%zx.%zx", (t_int)x, + (t_int)data); gui_vmess("gui_draw_erase_item", "xs", glist_getcanvas(glist), itemtagbuf); } @@ -4411,7 +4411,7 @@ static int draw_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"draw_click %f %f %d %d %g %g %lx\n", + //fprintf(stderr,"draw_click %f %f %d %d %g %g %zx\n", // basex, basey, xpix, ypix, glist_xtopixels(glist, basex), // glist_ytopixels(glist, basey), (t_int)data); t_draw *x = (t_draw *)z; @@ -4566,8 +4566,8 @@ void draw_notify(t_canvas *x, t_symbol *s, int argc, t_atom *argv) "from gui arrived"); return; } - long word_candidate = 0; /* from glob_findinstance */ - if (!sscanf(array_sym->s_name, "x%lx", &word_candidate)) + uint64_t word_candidate = 0; /* from glob_findinstance */ + if (!sscanf(array_sym->s_name, "x%zx", &word_candidate)) { pd_error(sc, "scalar: couldn't read array datum from GUI"); return; @@ -4585,7 +4585,7 @@ void draw_notify(t_canvas *x, t_symbol *s, int argc, t_atom *argv) a canvas field. If there's any in existence, forward the event notification. pd_bind takes care of the details of this-- if there are multiple [event] objects it will dispatch to each */ - sprintf(canvas_field_namebuf, "%lx_event", (long unsigned int)sc->sc_vec); + sprintf(canvas_field_namebuf, "%zx_event", (t_int)sc->sc_vec); canvas_field_event = gensym(canvas_field_namebuf); t_pd *target = canvas_field_event->s_thing; if (target) @@ -4625,7 +4625,7 @@ static int draw_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { post("hello?"); - //fprintf(stderr,"draw_click %f %f %d %d %lx\n", + //fprintf(stderr,"draw_click %f %f %d %d %zx\n", // basex, basey, xpix, ypix, (t_int)data); t_draw *x = (t_draw *)z; t_svg *sa = (t_svg *)x->x_attr; @@ -4748,7 +4748,7 @@ static void svg_free(t_svg *x) t_freebytes(x->x_nargs_per_cmd, x->x_npathcmds * sizeof(*x->x_nargs_per_cmd)); } char buf[50]; - sprintf(buf, "x%lx", (long unsigned int)x); + sprintf(buf, "x%zx", (t_int)x); pd_unbind((t_pd *)x->x_parent, gensym(buf)); } @@ -4894,7 +4894,7 @@ static void *event_new(void) t_canvas *c = canvas_getrootfor(canvas_getcurrent()); if (c->gl_vec) { - sprintf(namebuf, "%lx_event", (long unsigned int)c->gl_vec); + sprintf(namebuf, "%zx_event", (t_int)c->gl_vec); x->x_bindsym = gensym(namebuf); pd_bind(&x->x_obj.ob_pd, x->x_bindsym); } @@ -5115,7 +5115,7 @@ static void curve_getrect(t_gobj *z, t_glist *glist, t_word *data, t_template *template, t_float basex, t_float basey, int *xp1, int *yp1, int *xp2, int *yp2) { - //fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>curve_getrect %lx\n", (t_int)z); + //fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>curve_getrect %zx\n", (t_int)z); t_curve *x = (t_curve *)z; int i, n = x->x_npoints; t_fielddesc *f = x->x_vec; @@ -5329,14 +5329,14 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); gui_s(parent_tagbuf); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "curve%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "curve%zx.%zx", (t_int)x, + (t_int)data); gui_s(tagbuf); gui_end_array(); /* end of tags array */ gui_end_vmess(); @@ -5346,7 +5346,7 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, //glist_noselect(gl); //glist_select(gl, (t_gobj *)glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); @@ -5359,8 +5359,8 @@ static void curve_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, if (n > 1) { char itemtagbuf[MAXPDSTRING]; - sprintf(itemtagbuf, "curve%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(itemtagbuf, "curve%zx.%zx", (t_int)x, + (t_int)data); } } } @@ -5422,7 +5422,7 @@ static int curve_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"curve_click %f %f %d %d %lx\n", basex, basey, + //fprintf(stderr,"curve_click %f %f %d %d %zx\n", basex, basey, // xpix, ypix, (t_int)data); t_curve *x = (t_curve *)z; int i, n = x->x_npoints; @@ -5977,10 +5977,10 @@ static void plot_groupvis(t_scalar *x, t_glist *owner, t_word *data, { t_gobj *y; char tagbuf[MAXPDSTRING], parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)groupcanvas, - (long unsigned int)data); - sprintf(parent_tagbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_int)groupcanvas, + (t_int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", (t_int)parent, + (t_int)data); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, @@ -6203,13 +6203,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6322,13 +6322,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6402,13 +6402,13 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, gui_start_array(); char pbuf[MAXPDSTRING]; char tbuf[MAXPDSTRING]; - sprintf(pbuf, "dgroup%lx.%lx", - (long unsigned int)x->x_canvas, - (long unsigned int)data); - sprintf(tbuf, ".x%lx.x%lx.template%lx", - (long unsigned int)glist_getcanvas(glist), - (long unsigned int)glist, - (long unsigned int)data); + sprintf(pbuf, "dgroup%zx.%zx", + (t_int)x->x_canvas, + (t_int)data); + sprintf(tbuf, ".x%zx.x%zx.template%zx", + (t_int)glist_getcanvas(glist), + (t_int)glist, + (t_int)data); gui_s(pbuf); gui_s(pbuf); gui_end_array(); @@ -6418,7 +6418,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* make sure the array drawings are behind the graph */ /* not doing this yet with the GUI port... */ - //sys_vgui(".x%lx.c lower plot%lx graph%lx\n", glist_getcanvas(glist), + //sys_vgui(".x%zx.c lower plot%zx graph%zx\n", glist_getcanvas(glist), // data, glist); /* We're done with the outline; now draw all the points. @@ -6449,14 +6449,14 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* todo: need to check if plot itself is in an array */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", - (long unsigned int)elemtemplatecanvas, - (long unsigned int)((t_word *)(elem + elemsize * i))); + sprintf(tagbuf, "dgroup%zx.%zx", + (t_int)elemtemplatecanvas, + (t_int)((t_word *)(elem + elemsize * i))); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); char transform_buf[MAXPDSTRING]; sprintf(transform_buf, "translate(%g,%g)", usexloc, useyloc); @@ -6494,16 +6494,16 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { t_canvas *gl = glist_getcanvas(glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); } /* - sys_vgui(".x%lx.c lower .x%lx.x%lx.plot%lx %s\n", + sys_vgui(".x%zx.c lower .x%zx.x%zx.plot%zx %s\n", glist_getcanvas(glist), glist_getcanvas(glist), glist, data, rtext_gettag(glist_findrtext(glist_getcanvas(glist), &glist->gl_obj))); - sys_vgui(".x%lx.c raise .x%lx.x%lx.plot%lx %s\n", + sys_vgui(".x%zx.c raise .x%zx.x%zx.plot%zx %s\n", glist_getcanvas(glist), glist_getcanvas(glist), glist, data, rtext_gettag(glist_findrtext(glist_getcanvas(glist), &glist->gl_obj))); @@ -6532,7 +6532,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, } /* and then the trace */ - //sys_vgui(".x%lx.c delete .x%lx.x%lx.template%lx\n", + //sys_vgui(".x%zx.c delete .x%zx.x%zx.template%zx\n", // glist_getcanvas(glist), glist_getcanvas(glist), glist, data); } } @@ -6542,7 +6542,7 @@ static int plot_click(t_gobj *z, t_glist *glist, t_float basex, t_float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { - //fprintf(stderr,"plot_click %lx %lx %f %f %d %d\n", + //fprintf(stderr,"plot_click %zx %zx %f %f %d %d\n", // (t_int)z, (t_int)glist, basex, basey, xpix, ypix); t_plot *x = (t_plot *)z; t_symbol *elemtemplatesym; @@ -6582,7 +6582,7 @@ static void plot_free(t_plot *x) if (t) { t->t_transformable--; - //fprintf(stderr,"plot_free > template:%lx(%s) transform:%d\n", + //fprintf(stderr,"plot_free > template:%zx(%s) transform:%d\n", // (t_int)t, canvas_makebindsym(x->x_canvas->gl_name)->s_name, // t->t_transformable); } @@ -6735,10 +6735,10 @@ static void drawarray_groupvis(t_scalar *x, t_glist *owner, t_word *data, { t_gobj *y; char tagbuf[MAXPDSTRING], parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", (long unsigned int)groupcanvas, - (long unsigned int)data); - sprintf(parent_tagbuf, "dgroup%lx.%lx", (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "dgroup%zx.%zx", (t_int)groupcanvas, + (t_int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", (t_int)parent, + (t_int)data); gui_start_vmess("gui_scalar_draw_group", "xsss", glist_getcanvas(owner), tagbuf, @@ -6805,8 +6805,8 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* id for the the viewport-- we prefix it with "draw" to be compatible with the other svg-based drawcommands */ char viewport_tagbuf[MAXPDSTRING]; - sprintf(viewport_tagbuf, "draw%lx.%lx", - (long unsigned int)x, (long unsigned int)data); + sprintf(viewport_tagbuf, "draw%zx.%zx", + (t_int)x, (t_int)data); if (tovis) { @@ -6815,15 +6815,15 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* make sure the array drawings are behind the graph */ /* not doing this yet with the GUI port... */ - //sys_vgui(".x%lx.c lower plot%lx graph%lx\n", glist_getcanvas(glist), + //sys_vgui(".x%zx.c lower plot%zx graph%zx\n", glist_getcanvas(glist), // data, glist); /* 1. Set up the main <g> for this widget */ char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); t_svg *sa = (t_svg *)x->x_attr; gui_start_vmess("gui_draw_vis", "xs", glist_getcanvas(glist), "g"); @@ -6863,9 +6863,9 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, /* todo: need to check if drawarray itself is in an array */ char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "dgroup%lx.%lx", - (long unsigned int)elemtemplatecanvas, - (long unsigned int)((t_word *)(elem + elemsize * i))); + sprintf(tagbuf, "dgroup%zx.%zx", + (t_int)elemtemplatecanvas, + (t_int)((t_word *)(elem + elemsize * i))); char transform_buf[MAXPDSTRING]; sprintf(transform_buf, "translate(%g,%g)", usexloc, useyloc); @@ -6910,7 +6910,7 @@ static void drawarray_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { t_canvas *gl = glist_getcanvas(glist); char objtag[64]; - sprintf(objtag, ".x%lx.x%lx.template%lx", + sprintf(objtag, ".x%zx.x%zx.template%zx", (t_int)gl, (t_int)glist, (t_int)data); canvas_restore_original_position(gl, (t_gobj *)glist, objtag, -1); } @@ -6945,7 +6945,7 @@ static int drawarray_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { /* Let's hold off on this for a bit... - //fprintf(stderr,"drawarray_click %lx %lx %f %f %d %d\n", + //fprintf(stderr,"drawarray_click %zx %zx %f %f %d %d\n", // (t_int)z, (t_int)glist, basex, basey, xpix, ypix); t_drawarray *x = (t_drawarray *)z; t_symbol *elemtemplatesym; @@ -6984,7 +6984,7 @@ static void drawarray_free(t_drawarray *x) if (t) { t->t_transformable--; - //fprintf(stderr,"drawarray_free > template:%lx(%s) transform:%d\n", + //fprintf(stderr,"drawarray_free > template:%zx(%s) transform:%d\n", // (t_int)t, canvas_makebindsym(x->x_canvas->gl_name)->s_name, // t->t_transformable); } @@ -7313,13 +7313,13 @@ static void drawsymbol_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, colorstring); drawsymbol_getbuf(x, data, template, buf); char parent_tagbuf[MAXPDSTRING]; - sprintf(parent_tagbuf, "dgroup%lx.%lx", - (in_array ? (long unsigned int)parentglist : - (long unsigned int)x->x_canvas), - (long unsigned int)data); + sprintf(parent_tagbuf, "dgroup%zx.%zx", + (in_array ? (t_int)parentglist : + (t_int)x->x_canvas), + (t_int)data); char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "drawnumber%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "drawnumber%zx.%zx", (t_int)x, + (t_int)data); gui_vmess("gui_drawnumber_vis", "xssiiffsissii", glist_getcanvas(glist), parent_tagbuf, @@ -7338,8 +7338,8 @@ static void drawsymbol_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, else { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "drawnumber%lx.%lx", (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "drawnumber%zx.%zx", (t_int)x, + (t_int)data); gui_vmess("gui_draw_erase_item", "xs", glist_getcanvas(glist), tagbuf); } @@ -7564,7 +7564,7 @@ static void *drawimage_new(t_symbol *classsym, int argc, t_atom *argv) char *classname = classsym->s_name; char buf[50]; - sprintf(buf, "x%lx", (t_int)x); + sprintf(buf, "x%zx", (t_int)x); pd_bind(&x->x_obj.ob_pd, gensym(buf)); int flags = 0; @@ -7816,17 +7816,17 @@ static void drawimage_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, basex + fielddesc_getcoord(&svg->x_x.a_attr, template, data, 0)); int yloc = glist_ytopixels(glist, basey + fielddesc_getcoord(&svg->x_y.a_attr, template, data, 0)); - sys_vgui("pdtk_drawimage_vis .x%lx.c %d %d .x%lx .x%lx.i %d ",*/ + sys_vgui("pdtk_drawimage_vis .x%zx.c %d %d .x%zx .x%zx.i %d ",*/ t_float xloc = fielddesc_getcoord(&svg->x_x.a_attr, template, data, 0); t_float yloc = fielddesc_getcoord(&svg->x_y.a_attr, template, data, 0); char tagbuf[MAXPDSTRING]; char parent_tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, (long unsigned int)data); - sprintf(parent_tagbuf,"dgroup%lx.%lx", - in_array ? (long unsigned int)parentglist : (long unsigned int)parent, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, (t_int)data); + sprintf(parent_tagbuf,"dgroup%zx.%zx", + in_array ? (t_int)parentglist : (t_int)parent, + (t_int)data); gui_vmess("gui_drawimage_vis", "xffxxis", glist_getcanvas(glist), @@ -7846,7 +7846,7 @@ static void drawimage_vis(t_gobj *z, t_glist *glist, t_glist *parentglist, { /* We don't actually need this-- the image should get destroyed automatically. */ - //sys_vgui("pdtk_drawimage_unvis .x%lx.c .x%lx.i\n", + //sys_vgui("pdtk_drawimage_unvis .x%zx.c .x%zx.i\n", // glist_getcanvas(glist), data); } } @@ -7957,8 +7957,8 @@ static void drawimage_free(t_drawimage *x) { /* delete the parent image in the gui */ char buf[50]; - //sprintf(buf, ".x%lx", (t_int)x); - sprintf(buf, "x%lx", (long unsigned int)x); + //sprintf(buf, ".x%zx", (t_int)x); + sprintf(buf, "x%zx", (t_int)x); pd_unbind(&x->x_obj.ob_pd, gensym(buf)); gui_vmess("gui_image_free", "x", x); } @@ -8071,9 +8071,9 @@ void svg_parentwidgettogui(t_gobj *z, t_scalar *sc, t_glist *owner, if (pd_class(&z->g_pd) == draw_class) { t_draw *x = (t_draw *)z; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_togui((t_svg *)x->x_attr, template, data); @@ -8082,9 +8082,9 @@ void svg_parentwidgettogui(t_gobj *z, t_scalar *sc, t_glist *owner, else if (pd_class(&z->g_pd) == drawimage_class) { t_drawimage *x = (t_drawimage *)z; - sprintf(tagbuf, "draw%lx.%lx", - (long unsigned int)x, - (long unsigned int)data); + sprintf(tagbuf, "draw%zx.%zx", + (t_int)x, + (t_int)data); gui_start_vmess("gui_draw_configure_all", "xs", glist_getcanvas(owner), tagbuf); svg_togui((t_svg *)x->x_attr, template, data); diff --git a/pd/src/g_text.c b/pd/src/g_text.c index 9fe0c0761..f6500a8b0 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -1395,7 +1395,7 @@ static void gatom_vis(t_gobj *z, t_glist *glist, int vis) /* We're just deleting the parent gobj in the GUI, which takes care of removing all the children. So we don't need to send a message here */ - //sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %zx.l\n", glist_getcanvas(glist), x); } } if (!vis) @@ -1855,7 +1855,7 @@ static void dropdown_vis(t_gobj *z, t_glist *glist, int vis) /* We're just deleting the parent gobj in the GUI, which takes care of removing all the children. So we don't need to send a message here */ - //sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x); + //sys_vgui(".x%zx.c delete %zx.l\n", glist_getcanvas(glist), x); } } if (!vis) @@ -1888,7 +1888,7 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) x->a_text.te_width = 6; /* bind symbol for sending index updates from the GUI */ - sprintf(tagbuf, "x%lx", (long unsigned int)x); + sprintf(tagbuf, "x%zx", (t_int)x); pd_bind(&x->a_text.te_pd, gensym(tagbuf)); binbuf_add(x->a_text.te_binbuf, 1, binbuf_getvec(x->a_names)); @@ -1951,7 +1951,7 @@ void canvas_dropdown(t_glist *gl, t_symbol *s, int argc, t_atom *argv) static void dropdown_free(t_dropdown *x) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, "x%lx", (long unsigned int)x); + sprintf(tagbuf, "x%zx", (t_int)x); pd_unbind(&x->a_text.te_pd, gensym(tagbuf)); if (*x->a_symfrom->s_name) @@ -2259,7 +2259,7 @@ static void text_vis(t_gobj *z, t_glist *glist, int vis) t_rtext *y = glist_findrtext(glist, x); if (gobj_shouldvis(&x->te_g, glist)) { - //fprintf(stderr," erase it %lx %lx\n", x, glist); + //fprintf(stderr," erase it %zx %zx\n", x, glist); text_erase_gobj(x, glist, rtext_gettag(y)); //text_eraseborder(x, glist, rtext_gettag(y)); //rtext_erase(y); @@ -2609,7 +2609,7 @@ void text_drawborder(t_text *x, t_glist *glist, } else { - //fprintf(stderr, "redrawing rectangle? .x%lx.c %sR\n", + //fprintf(stderr, "redrawing rectangle? .x%zx.c %sR\n", // (t_int)glist_getcanvas(glist), tag); gui_vmess("gui_text_redraw_border", "xsii", glist_getcanvas(glist), @@ -2711,13 +2711,13 @@ void glist_eraseiofor(t_glist *glist, t_object *ob, char *tag) n = obj_noutlets(ob); for (i = 0; i < n; i++) { - //sys_vgui(".x%lx.c delete %so%d\n", + //sys_vgui(".x%zx.c delete %so%d\n", // glist_getcanvas(glist), tag, i); } n = obj_ninlets(ob); for (i = 0; i < n; i++) { - //sys_vgui(".x%lx.c delete %si%d\n", + //sys_vgui(".x%zx.c delete %si%d\n", // glist_getcanvas(glist), tag, i); } } diff --git a/pd/src/m_memory.c b/pd/src/m_memory.c index 39d77babc..f28b47e32 100644 --- a/pd/src/m_memory.c +++ b/pd/src/m_memory.c @@ -25,7 +25,7 @@ void *getbytes(size_t nbytes) ret = (void *)calloc(nbytes, 1); #ifdef LOUD - fprintf(stderr, "new %lx %d\n", (int)ret, nbytes); + fprintf(stderr, "new %zx %d\n", (int)ret, nbytes); #endif /* LOUD */ #ifdef DEBUGMEM @@ -59,7 +59,7 @@ void *resizebytes(void *old, size_t oldsize, size_t newsize) if (newsize > oldsize && ret) memset(((char *)ret) + oldsize, 0, newsize - oldsize); #ifdef LOUD - fprintf(stderr, "resize %lx %d --> %lx %d\n", (int)old, oldsize, (int)ret, newsize); + fprintf(stderr, "resize %zx %d --> %zx %d\n", (int)old, oldsize, (int)ret, newsize); #endif /* LOUD */ #ifdef DEBUGMEM totalmem += (newsize - oldsize); @@ -74,7 +74,7 @@ void freebytes(void *fatso, size_t nbytes) if (nbytes == 0) nbytes = 1; #ifdef LOUD - fprintf(stderr, "free %lx %d\n", (int)fatso, nbytes); + fprintf(stderr, "free %zx %d\n", (int)fatso, nbytes); #endif /* LOUD */ #ifdef DEBUGMEM totalmem -= nbytes; diff --git a/pd/src/m_pd.c b/pd/src/m_pd.c index 7e2f98269..f4d48b2ff 100644 --- a/pd/src/m_pd.c +++ b/pd/src/m_pd.c @@ -198,7 +198,7 @@ void pd_bind(t_pd *x, t_symbol *s) { if (*s->s_thing == bindlist_class) { - //fprintf(stderr," pd_bind option 1A %lx\n", (t_int)x); + //fprintf(stderr," pd_bind option 1A %zx\n", (t_int)x); t_bindlist *b = (t_bindlist *)s->s_thing; t_bindelem *e = (t_bindelem *)getbytes(sizeof(t_bindelem)); e->e_next = b->b_list; @@ -208,7 +208,7 @@ void pd_bind(t_pd *x, t_symbol *s) } else { - //fprintf(stderr," pd_bind option 1B %lx\n", (t_int)x); + //fprintf(stderr," pd_bind option 1B %zx\n", (t_int)x); t_bindlist *b = (t_bindlist *)pd_new(bindlist_class); t_bindelem *e1 = (t_bindelem *)getbytes(sizeof(t_bindelem)); t_bindelem *e2 = (t_bindelem *)getbytes(sizeof(t_bindelem)); @@ -223,7 +223,7 @@ void pd_bind(t_pd *x, t_symbol *s) } } else { - //fprintf(stderr,"pd_bind option 2 %lx\n", (t_int)x); + //fprintf(stderr,"pd_bind option 2 %zx\n", (t_int)x); s->s_thing = x; } } @@ -232,7 +232,7 @@ void pd_unbind(t_pd *x, t_symbol *s) { //fprintf(stderr,"pd_unbind %s\n", s->s_name); if (s->s_thing == x) { - //fprintf(stderr," pd_unbind option A %lx\n", (t_int)x); + //fprintf(stderr," pd_unbind option A %zx\n", (t_int)x); s->s_thing = 0; } else if (s->s_thing && *s->s_thing == bindlist_class) @@ -248,7 +248,7 @@ void pd_unbind(t_pd *x, t_symbol *s) which we call bindlist_cleanup(). we control the execution via static int variable change_bindlist_via_graph */ - //fprintf(stderr," pd_unbind option B %lx\n", (t_int)x); + //fprintf(stderr," pd_unbind option B %zx\n", (t_int)x); t_bindlist *b = (t_bindlist *)s->s_thing; t_bindelem *e, *e2; @@ -330,7 +330,7 @@ t_pd *pd_findbyclass(t_symbol *s, t_class *c) //fprintf(stderr, "(e_who == c)?%d || e->e_delayed_free=%d\n", (*e->e_who == c ? 1 : 0), e->e_delayed_free); if (e->e_delayed_free != 1 && *e->e_who == c) { - //fprintf(stderr,"...found %lx", e); + //fprintf(stderr,"...found %zx", e); if (x && !warned) { zz(); diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index 5d12b3e41..4448c73db 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -87,8 +87,12 @@ typedef unsigned __int64 uint64_t; /* signed and unsigned integer types the size of a pointer: */ #if !defined(PD_LONGINTTYPE) +#if defined(_WIN32) && defined(_WIN64) +#define PD_LONGINTTYPE long long +#else #define PD_LONGINTTYPE long #endif +#endif #if !defined(PD_FLOATSIZE) #define PD_FLOATSIZE 32 /* 32 for single precision or 64 for double precision */ @@ -724,7 +728,7 @@ EXTERN void gui_start_array(void); EXTERN void gui_f(t_float f); /* send a float element in an array */ EXTERN void gui_i(int i); /* send an int element in an array */ EXTERN void gui_s(const char *s); /* send a string element in an array */ -EXTERN void gui_x(long unsigned int i); +EXTERN void gui_x(t_int i); EXTERN void gui_end_array(void); EXTERN void gui_end_vmess(void); diff --git a/pd/src/makefile.mingw b/pd/src/makefile.mingw index 740adc89b..c62b9eaaf 100755 --- a/pd/src/makefile.mingw +++ b/pd/src/makefile.mingw @@ -62,7 +62,7 @@ WARN_CFLAGS = -Wall -W -Wstrict-prototypes -Wno-unused \ # next minor version of Windows, 5.2. ARCH_CFLAGS = -DPD -DPD_INTERNAL -DMSW -DPA_USE_ASIO -DPA_USE_WMME \ -DWINVER=0x0502 -DUSEAPI_MMIO -DUSEAPI_PORTAUDIO -mms-bitfields \ - -DWISHAPP='"wish85.exe"' + -DWISHAPP='"wish85.exe"' -D__USE_MINGW_ANSI_STDIO=1 CFLAGS += $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS) diff --git a/pd/src/s_audio_alsamm.c b/pd/src/s_audio_alsamm.c index 604d0fe76..105449693 100644 --- a/pd/src/s_audio_alsamm.c +++ b/pd/src/s_audio_alsamm.c @@ -242,7 +242,7 @@ int alsamm_open_audio(int rate, int blocksize) for(i=0;i<alsa_noutdev;i++) { - /* post("open audio out %d, of %lx, %d",i,&alsa_device[i], + /* post("open audio out %d, of %zx, %d",i,&alsa_device[i], alsa_outdev[i].a_handle); */ if((err = set_hwparams(alsa_outdev[i].a_handle, hw_params, &(alsa_outdev[i].a_channels))) < 0) @@ -370,7 +370,7 @@ void alsamm_close_audio(void) #ifdef ALSAMM_DEBUG if(sys_verbose) - post("unlink audio out %d, of %lx",i,used_outdevice[i]); + post("unlink audio out %d, of %zx",i,used_outdevice[i]); #endif if(alsa_outdev[i].a_synced != 0){ diff --git a/pd/src/s_file.c b/pd/src/s_file.c index 782eeb68c..288068040 100644 --- a/pd/src/s_file.c +++ b/pd/src/s_file.c @@ -230,8 +230,8 @@ static void sys_putpreference(const char *key, const char *value) NULL, &hkey, NULL); if (err != ERROR_SUCCESS) { - post("unable to create registry entry: %s: error %lx\n", key, - (long unsigned int)err); + post("unable to create registry entry: %s: error %zx\n", key, + (t_int)err); return; } err = RegSetValueEx(hkey, key, 0, REG_EXPAND_SZ, value, strlen(value)+1); diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c index baa38b641..4d574b503 100644 --- a/pd/src/s_inter.c +++ b/pd/src/s_inter.c @@ -57,7 +57,7 @@ static int isatty(int fd) {return 0;} typedef int pid_t; # endif typedef int socklen_t; -#define EADDRINUSE WSAEADDRINUSE +//#define EADDRINUSE WSAEADDRINUSE #endif #include <stdarg.h> @@ -94,7 +94,7 @@ typedef int socklen_t; #define LOCALHOST "localhost" #endif -#define X_SPECIFIER "x%.6lx" +#define X_SPECIFIER "x%.6zx" #if PD_FLOATSIZE == 32 #define FLOAT_SPECIFIER "%.6g" @@ -501,12 +501,12 @@ static int socketreceiver_doread(t_socketreceiver *x) if (c == ';' && (!indx || inbuf[indx-1] != '\\')) { intail = (indx+1)&(INBUFSIZE-1); - binbuf_text(inbinbuf, messbuf, bp - messbuf); + binbuf_text(inbinbuf, messbuf, (int)(bp - messbuf)); if (sys_debuglevel & DEBUG_MESSDOWN) { if (stderr_isatty) - fprintf(stderr,"\n<- \e[0;1;36m%.*s\e[0m", bp - messbuf, messbuf); + fprintf(stderr,"\n<- \e[0;1;36m%.*s\e[0m", (int)(bp - messbuf), messbuf); else - fprintf(stderr,"\n<- %.*s", bp - messbuf, messbuf); + fprintf(stderr,"\n<- %.*s", (int)(bp - messbuf), messbuf); } x->sr_inhead = inhead; x->sr_intail = intail; @@ -887,7 +887,7 @@ void gui_do_vmess(const char *sel, char *fmt, int end, va_list ap) case 's': escape_double_quotes(va_arg(ap, const char *)); break; case 'i': sys_vgui("%d", va_arg(ap, int)); break; case 'x': sys_vgui("\"" X_SPECIFIER "\"", - va_arg(ap, long unsigned int)); + va_arg(ap, t_int)); break; //case 'p': SETPOINTER(at, va_arg(ap, t_gpointer *)); break; default: goto done; @@ -965,7 +965,7 @@ void gui_s(const char *s) gui_array_tail = 0; } -void gui_x(long unsigned int i) +void gui_x(t_int i) { if (gui_array_head && !gui_array_tail) sys_vgui("\"x%.6lx\"", i); @@ -1438,7 +1438,7 @@ int sys_startgui(const char *guidir) portno, (sys_k12_mode ? "pd-l2ork-k12" : "pd-l2ork"), guidir2, - (long unsigned int)pd_this); + (t_int)pd_this); #else sprintf(cmdbuf, "TCL_LIBRARY=\"%s/tcl/library\" TK_LIBRARY=\"%s/tk/library\" \ @@ -1480,7 +1480,7 @@ int sys_startgui(const char *guidir) portno, (sys_k12_mode ? "pd-l2ork-k12" : "pd-l2ork"), guidir2, - (long unsigned int)pd_this); + (t_int)pd_this); #endif sys_guicmd = cmdbuf; } @@ -1537,7 +1537,7 @@ int sys_startgui(const char *guidir) //sys_bashfilename(scriptbuf, scriptbuf); char pd_this_string[80]; - sprintf(pd_this_string, X_SPECIFIER, (long unsigned int)pd_this); + sprintf(pd_this_string, X_SPECIFIER, (t_int)pd_this); sprintf(scriptbuf, "\""); /* use quotes in case there are spaces */ strcat(scriptbuf, sys_libdir->s_name); strcat(scriptbuf, "/" PDBINDIR); diff --git a/pd/src/s_main.c b/pd/src/s_main.c index 525d6de1f..2dbc5e906 100644 --- a/pd/src/s_main.c +++ b/pd/src/s_main.c @@ -352,14 +352,14 @@ int sys_main(int argc, char **argv) if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); /* use Win32 "binary" mode by default since we don't want the * translation that Win32 does by default */ -# ifdef _MSC_VER /* MS Visual Studio */ +# ifdef MSC /* MS Visual Studio */ _set_fmode( _O_BINARY ); # else /* MinGW */ { extern int _fmode; _fmode = _O_BINARY; } -# endif /* _MSC_VER */ +# endif /* MSC */ #endif /* _WIN32 */ #ifndef _WIN32 /* long ago Pd used setuid to promote itself to real-time priority. @@ -372,7 +372,7 @@ int sys_main(int argc, char **argv) } #endif /* _WIN32 */ pd_init(); /* start the message system */ - logpost(NULL, 2, "PD_FLOATSIZE = %lu bits", sizeof(t_float)*8); + logpost(NULL, 2, "PD_FLOATSIZE = %u bits", (unsigned)sizeof(t_float)*8); sys_findprogdir(argv[0]); /* set sys_progname, guipath */ for (i = noprefs = 0; i < argc; i++) /* prescan args for noprefs */ if (!strcmp(argv[i], "-noprefs")) diff --git a/pd/src/s_print.c b/pd/src/s_print.c index e00b814f3..3a9cb6469 100644 --- a/pd/src/s_print.c +++ b/pd/src/s_print.c @@ -43,7 +43,7 @@ static char* strnpointerid(char *dest, const void *pointer, size_t len) { *dest=0; if (pointer) - snprintf(dest, len, ".x%lx", (unsigned long)pointer); + snprintf(dest, len, ".x%zx", (t_int)pointer); return dest; } @@ -267,8 +267,8 @@ void glob_finderror(t_pd *dummy) void glob_findinstance(t_pd *dummy, t_symbol*s) { // revert s to (potential) pointer to object - long obj = 0; - if (sscanf(s->s_name, ".x%lx", &obj)) + t_int obj = 0; + if (sscanf(s->s_name, ".x%zx", &obj)) { if (obj) { diff --git a/pd/src/x_gui.c b/pd/src/x_gui.c index b5b66ca6b..e7473a216 100644 --- a/pd/src/x_gui.c +++ b/pd/src/x_gui.c @@ -68,7 +68,7 @@ void gfxstub_new(t_pd *owner, void *key, const char *cmd) return; } x = (t_gfxstub *)pd_new(gfxstub_class); - sprintf(namebuf, ".gfxstub%lx", (t_int)x); + sprintf(namebuf, ".gfxstub%zx", (t_int)x); s = gensym(namebuf); pd_bind(&x->x_pd, s); @@ -99,7 +99,7 @@ char *gfxstub_new2(t_pd *owner, void *key) if (x->x_key == key) gfxstub_deleteforkey(key); x = (t_gfxstub *)pd_new(gfxstub_class); - sprintf(namebuf, ".gfxstub%lx", (t_int)x); + sprintf(namebuf, ".gfxstub%zx", (t_int)x); s = gensym(namebuf); pd_bind(&x->x_pd, s); x->x_owner = owner; @@ -154,7 +154,7 @@ void gfxstub_deleteforkey(void *key) if (y->x_key == key) { char tagbuf[MAXPDSTRING]; - sprintf(tagbuf, ".gfxstub%lx", (long unsigned int)y); + sprintf(tagbuf, ".gfxstub%zx", (t_int)y); gui_vmess("gui_remove_gfxstub", "s", tagbuf); @@ -245,7 +245,7 @@ static void *openpanel_new( void) char buf[50]; t_openpanel *x = (t_openpanel *)pd_new(openpanel_class); x->x_canvas = canvas_getcurrent(); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_int)x); x->x_s = gensym(buf); pd_bind(&x->x_obj.ob_pd, x->x_s); outlet_new(&x->x_obj, &s_symbol); @@ -303,7 +303,7 @@ static void *savepanel_new( void) { char buf[50]; t_savepanel *x = (t_savepanel *)pd_new(savepanel_class); - sprintf(buf, "d%lx", (t_int)x); + sprintf(buf, "d%zx", (t_int)x); x->x_s = gensym(buf); x->x_canvas = canvas_getcurrent(); pd_bind(&x->x_obj.ob_pd, x->x_s); diff --git a/pd/src/x_interface.c b/pd/src/x_interface.c index 79c204023..bab59fa2f 100644 --- a/pd/src/x_interface.c +++ b/pd/src/x_interface.c @@ -582,7 +582,7 @@ void canvasinfo_name(t_canvasinfo *x, t_symbol *s, int argc, t_atom *argv) { t_canvas *c = canvas_climb(x->x_canvas, x->x_depth); char buf[MAXPDSTRING]; - snprintf(buf, MAXPDSTRING, "x%lx", (long unsigned int)c); + snprintf(buf, MAXPDSTRING, "x%zx", (t_int)c); t_atom at[1]; SETSYMBOL(at, gensym(buf)); info_out((t_text *)x, s, 1, at); diff --git a/pd/src/x_preset.c b/pd/src/x_preset.c index 65da15c8c..7d8bad6e7 100644 --- a/pd/src/x_preset.c +++ b/pd/src/x_preset.c @@ -434,7 +434,7 @@ static void preset_node_update_my_glist_location(t_preset_node *x) at this point is still null since this means this is being called at the end of the preset_node_new call */ if (PH_DEBUG) - fprintf(stderr," location = %d %lx %lx\n", + fprintf(stderr," location = %d %zx %zx\n", i, (t_int)g, (t_int)target); x->pn_gl_loc[j] = i; @@ -477,7 +477,7 @@ static void preset_node_update_my_glist_location(t_preset_node *x) as well as when hubs try to query nodes that have not been paired yet. */ void preset_node_seek_hub(t_preset_node *x) { - if(PH_DEBUG) fprintf(stderr,"preset_node_seek_hub %lx\n", (t_int)x->pn_hub); + if(PH_DEBUG) fprintf(stderr,"preset_node_seek_hub %zx\n", (t_int)x->pn_hub); if (we_are_undoing) return; t_canvas *y = x->pn_canvas; @@ -529,16 +529,16 @@ static int preset_node_location_changed(t_preset_node *x) static void preset_node_anything(t_preset_node *x, t_symbol *s, int argc, t_atom *argv) { - if (PH_DEBUG) fprintf(stderr,"preset_node_anything %lx %s %d\n", (t_int)x, s->s_name, argc); + if (PH_DEBUG) fprintf(stderr,"preset_node_anything %zx %s %d\n", (t_int)x, s->s_name, argc); int i; alist_list(&x->pn_val, 0, argc, argv); if (PH_DEBUG) { if (x->pn_val.l_vec->l_a.a_type == A_SYMBOL) - fprintf(stderr," %lx data is %s\n", + fprintf(stderr," %zx data is %s\n", (t_int)x, x->pn_val.l_vec->l_a.a_w.w_symbol->s_name); else if (x->pn_val.l_vec->l_a.a_type == A_FLOAT) - fprintf(stderr," %lx data is %f\n", + fprintf(stderr," %zx data is %f\n", (t_int)x, x->pn_val.l_vec->l_a.a_w.w_float); } // check for pointers and warn user presetting them has not been tested @@ -609,7 +609,7 @@ void preset_node_request_hub_writepreset(t_preset_node *x, t_symbol *filename, void preset_node_set_and_output_value(t_preset_node *x, t_alist val) { if(PH_DEBUG) - fprintf(stderr,"preset_node_set_and_output_value %lx\n", (t_int)x); + fprintf(stderr,"preset_node_set_and_output_value %zx\n", (t_int)x); t_atom *outv; if (val.l_n > 0) { @@ -621,10 +621,10 @@ void preset_node_set_and_output_value(t_preset_node *x, t_alist val) if(PH_DEBUG) { if (outv->a_type == A_SYMBOL) - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)x, outv->a_w.w_symbol->s_name); else if (outv->a_type == A_FLOAT) - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)x, outv->a_w.w_float); } XL_ATOMS_FREEA(outv, x->pn_val.l_n); @@ -1186,14 +1186,14 @@ void preset_hub_store(t_preset_hub *h, t_float f) if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_SYMBOL) { - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)hd1->phd_node, hd1->phd_node->pn_val.l_vec->l_a.a_w.w_symbol->s_name); } else if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_FLOAT) { - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)hd1->phd_node, hd1->phd_node->pn_val.l_vec->l_a.a_w.w_float); } @@ -1209,14 +1209,14 @@ void preset_hub_store(t_preset_hub *h, t_float f) if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_SYMBOL) { - fprintf(stderr," %lx outputs %s\n", + fprintf(stderr," %zx outputs %s\n", (t_int)hd1->phd_node, np2->np_val.l_vec->l_a.a_w.w_symbol->s_name); } else if (hd1->phd_node->pn_val.l_vec->l_a.a_type == A_FLOAT) { - fprintf(stderr," %lx outputs %f\n", + fprintf(stderr," %zx outputs %f\n", (t_int)hd1->phd_node, np2->np_val.l_vec->l_a.a_w.w_float); } diff --git a/pd/src/x_text.c b/pd/src/x_text.c index 4e5fe060e..10fe02112 100644 --- a/pd/src/x_text.c +++ b/pd/src/x_text.c @@ -80,13 +80,13 @@ static void textbuf_senditup(t_textbuf *x) if (!x->b_guiconnect) return; binbuf_gettext(x->b_binbuf, &txt, &ntxt); - //sys_vgui("pdtk_textwindow_clear .x%lx\n", x); + //sys_vgui("pdtk_textwindow_clear .x%zx\n", x); gui_vmess("gui_text_dialog_clear", "x", x); for (i = 0; i < ntxt; ) { char *j = strchr(txt+i, '\n'); if (!j) j = txt + ntxt; - //sys_vgui("pdtk_textwindow_append .x%lx {%.*s\n}\n", + //sys_vgui("pdtk_textwindow_append .x%zx {%.*s\n}\n", // x, j-txt-i, txt+i); if (j - txt - i >= MAXPDSTRING) { @@ -94,12 +94,12 @@ static void textbuf_senditup(t_textbuf *x) MAXPDSTRING); break; } - sprintf(buf, "%.*s\n", j-txt-i, txt+i); + sprintf(buf, "%.*s\n", (int)(j-txt-i), txt+i); gui_vmess("gui_text_dialog_append", "xs", x, buf); i = (j-txt)+1; } - //sys_vgui("pdtk_textwindow_setdirty .x%lx 0\n", x); + //sys_vgui("pdtk_textwindow_setdirty .x%zx 0\n", x); gui_vmess("gui_text_dialog_set_dirty", "xi", x, 0); t_freebytes(txt, ntxt); } @@ -114,19 +114,19 @@ static void textbuf_open(t_textbuf *x) { if (x->b_guiconnect) { - //sys_vgui("wm deiconify .x%lx\n", x); - //sys_vgui("raise .x%lx\n", x); - //sys_vgui("focus .x%lx.text\n", x); + //sys_vgui("wm deiconify .x%zx\n", x); + //sys_vgui("raise .x%zx\n", x); + //sys_vgui("focus .x%zx.text\n", x); gui_vmess("gui_text_dialog_raise", "x", x); } else { char buf[40]; - //sys_vgui("pdtk_textwindow_open .x%lx %dx%d {%s: %s} %d\n", + //sys_vgui("pdtk_textwindow_open .x%zx %dx%d {%s: %s} %d\n", // x, 600, 340, "myname", "text", // sys_hostfontsize(glist_getfont(x->b_canvas)));//, //glist_getzoom(x->b_canvas))); - sprintf(buf, "x%lx", (unsigned long)x); + sprintf(buf, "x%zx", (t_int)x); x->b_guiconnect = guiconnect_new(&x->b_ob.ob_pd, gensym(buf)); gui_vmess("gui_text_dialog", "xsiii", x, @@ -140,7 +140,7 @@ static void textbuf_open(t_textbuf *x) static void textbuf_close(t_textbuf *x) { - //sys_vgui("pdtk_textwindow_doclose .x%lx\n", x); + //sys_vgui("pdtk_textwindow_doclose .x%zx\n", x); gui_vmess("gui_text_dialog_close_from_pd", "x", x, 1); if (x->b_guiconnect) { @@ -238,7 +238,7 @@ static void textbuf_free(t_textbuf *x) binbuf_free(x->b_binbuf); if (x->b_guiconnect) { - //sys_vgui("destroy .x%lx\n", x); + //sys_vgui("destroy .x%zx\n", x); gui_vmess("gui_text_dialog_close_from_pd", "xi", x, 0); guiconnect_notarget(x->b_guiconnect, 1000); } diff --git a/pd/src/x_vexp.c b/pd/src/x_vexp.c index b11bc5f96..cee584d24 100644 --- a/pd/src/x_vexp.c +++ b/pd/src/x_vexp.c @@ -541,7 +541,7 @@ ex_parse(struct expr *x, struct ex_ex *iptr, struct ex_ex *optr, long int *argc) long count; if (!iptr) { - post("ex_parse: input is null, iptr = 0x%lx\n", iptr); + post("ex_parse: input is null, iptr = 0x%zx\n", iptr); return (exNULL); } if (!iptr->ex_type) @@ -674,7 +674,7 @@ ex_parse(struct expr *x, struct ex_ex *iptr, struct ex_ex *optr, long int *argc) case ET_STR: default: ex_print(eptr); - post("expr: ex_parse: type = 0x%lx\n", eptr->ex_type); + post("expr: ex_parse: type = 0x%zx\n", eptr->ex_type); return (exNULL); } @@ -2077,10 +2077,10 @@ ex_print(struct ex_ex *eptr) post("$f%ld ", eptr->ex_int + 1); break; case ET_SI: - post("$s%lx ", eptr->ex_ptr); + post("$s%zx ", eptr->ex_ptr); break; case ET_VI: - post("$v%lx ", eptr->ex_vec); + post("$v%zx ", eptr->ex_vec); break; case ET_VEC: post("vec = %ld ", eptr->ex_vec); @@ -2180,11 +2180,11 @@ ex_print(struct ex_ex *eptr) post("%c", ';'); break; default: - post("expr: ex_print: bad op 0x%lx\n", eptr->ex_op); + post("expr: ex_print: bad op 0x%zx\n", eptr->ex_op); } break; default: - post("expr: ex_print: bad type 0x%lx\n", eptr->ex_type); + post("expr: ex_print: bad type 0x%zx\n", eptr->ex_type); } eptr++; } -- GitLab