Commit 94c62e36 authored by Albert Gräf's avatar Albert Gräf Committed by Albert Gräf
Browse files

mingw64 fixes: correct 64 bit int types and casts, switch to portable ANSI formats.

parent 6b376222
......@@ -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
......
......@@ -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;
}
......
......@@ -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)) {
......
......@@ -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);
}
......@@ -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();
}
......
......@@ -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);
......
......@@ -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?? */
......
......@@ -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);