Commit 9670411d authored by Albert Gräf's avatar Albert Gräf Committed by Albert Gräf
Browse files

mingw64 fixes: for cosmetic purposes, add a t_uint type.

This is useful, in particular, to print out pointer values with the
%zx specifier, since it prevents the annoying format warnings when
using %zx with t_int.
parent 94c62e36
......@@ -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%zx.c", (t_int) canvas);
sprintf(buf,".x%zx.c", (t_uint) 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%zx", x->canvas_id, (t_int)x);
sprintf(buf,"%s.frame%zx", x->canvas_id, (t_uint)x);
x->frame_id = getbytes(strlen(buf) + 1);
strcpy(x->frame_id, buf);
sprintf(buf,"%s.text%zx", x->frame_id, (t_int)x);
sprintf(buf,"%s.text%zx", x->frame_id, (t_uint)x);
x->text_id = getbytes(strlen(buf) + 1);
strcpy(x->text_id, buf); /* Tk ID for the "text", the meat! */
sprintf(buf,"%s.window%zx", x->canvas_id, (t_int)x);
sprintf(buf,"%s.window%zx", x->canvas_id, (t_uint)x);
x->window_tag = getbytes(strlen(buf) + 1);
strcpy(x->window_tag, buf); /* Tk ID for the resizing "window" */
sprintf(buf,"%s.handle%zx", x->canvas_id, (t_int)x);
sprintf(buf,"%s.handle%zx", x->canvas_id, (t_uint)x);
x->handle_id = getbytes(strlen(buf) + 1);
strcpy(x->handle_id, buf); /* Tk ID for the resizing "handle" */
sprintf(buf,"%s.scrollbar%zx", x->frame_id, (t_int)x);
sprintf(buf,"%s.scrollbar%zx", x->frame_id, (t_uint)x);
x->scrollbar_id = getbytes(strlen(buf) + 1);
strcpy(x->scrollbar_id, buf); /* Tk ID for the optional "scrollbar" */
sprintf(buf,"all%zx", (t_int)x);
sprintf(buf,"all%zx", (t_uint)x);
x->all_tag = getbytes(strlen(buf) + 1);
strcpy(x->all_tag, buf); /* Tk ID for the optional "scrollbar" */
}
......@@ -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%zx",(t_int)x);
sprintf(buf,"entry%zx",(t_uint)x);
x->tcl_namespace = getbytes(strlen(buf) + 1);
strcpy(x->tcl_namespace, buf);
......
......@@ -621,7 +621,7 @@ static void *popup_new(t_symbol *s, int argc, t_atom *argv)
}
/* Bind the recieve "popup%zx" to the widget outlet*/
sprintf(buf,"popup%zx", (t_int)x);
sprintf(buf,"popup%zx", (t_uint)x);
x->x_sym = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_sym);
......
......@@ -313,7 +313,7 @@ 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%zx", (t_int)x);
sprintf(buf,"button%zx", (t_uint)x);
x->x_sym = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_sym);
......
......@@ -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, "#%zx", (t_int)x);
sprintf(buf, "#%zx", (t_uint)x);
x->x_receive = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_receive);
outlet_new(&x->x_obj, &s_bang);
......
......@@ -18,7 +18,7 @@ typedef struct _canvas_name
static t_symbol* make_canvas_symbol(t_canvas* canvas)
{
char buf[MAXPDSTRING];
snprintf(buf, MAXPDSTRING, ".x%zx.c", (t_int)canvas);
snprintf(buf, MAXPDSTRING, ".x%zx.c", (t_uint)canvas);
return gensym(buf);
}
......
......@@ -80,7 +80,7 @@ static void *colorpanel_new( void)
{
char buf[MAXPDSTRING];
t_colorpanel *x = (t_colorpanel *)pd_new(colorpanel_class);
sprintf(buf, "#%zx", (t_int)x);
sprintf(buf, "#%zx", (t_uint)x);
x->x_s = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_s);
outlet_new(&x->x_obj, &s_list);
......
......@@ -110,7 +110,7 @@ static void *cursor_new(void)
x->parent_canvas = canvas_getcurrent();
sprintf(buf, "#%zx", (t_int)x);
sprintf(buf, "#%zx", (t_uint)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);
......
......@@ -29,7 +29,7 @@ static void *screensize_new(void)
char buf[MAXPDSTRING];
t_screensize *x = (t_screensize *)pd_new(screensize_class);
sprintf(buf, "#%zx", (t_int)x);
sprintf(buf, "#%zx", (t_uint)x);
x->receive_symbol = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->receive_symbol);
......
......@@ -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, "#%zx", (t_int)x);
sprintf(buf, "#%zx", (t_uint)x);
x->x_receive_symbol = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_receive_symbol);
......
......@@ -18,7 +18,7 @@ typedef struct _window_name
static t_symbol* make_canvas_symbol(t_canvas* canvas)
{
char buf[MAXPDSTRING];
snprintf(buf, MAXPDSTRING, ".x%zx", (t_int)canvas);
snprintf(buf, MAXPDSTRING, ".x%zx", (t_uint)canvas);
return gensym(buf);
}
......
......@@ -122,7 +122,7 @@ static void *receivecanvas_new(t_floatarg f)
if(canvas) {
char buf[MAXPDSTRING];
snprintf(buf, MAXPDSTRING-1, "x%zx", (t_int)canvas);
snprintf(buf, MAXPDSTRING-1, "x%zx", (t_uint)canvas);
buf[MAXPDSTRING-1]=0;
x->x_proxy=receivecanvas_proxy_new(x, gensym(buf));
......
......@@ -36,7 +36,7 @@ static void *active_new(void)
{
t_active *x = (t_active *)pd_new(active_class);
char buf[32];
sprintf(buf, ".x%zx.c", (t_int)canvas_getcurrent());
sprintf(buf, ".x%zx.c", (t_uint)canvas_getcurrent());
x->x_cvname = gensym(buf);
x->x_on = 0;
outlet_new((t_object *)x, &s_float);
......
......@@ -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%zx", (t_int)x);
sprintf(x->x_texttag, "t%zx", (t_int)x);
sprintf(x->x_outlinetag, "h%zx", (t_int)x);
sprintf(x->x_tag, "all%zx", (t_uint)x);
sprintf(x->x_texttag, "t%zx", (t_uint)x);
sprintf(x->x_outlinetag, "h%zx", (t_uint)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%zx", (t_int)x);
sprintf(buf, "miXed%zx", (t_uint)x);
x->x_bindsym = gensym(buf);
pd_bind((t_pd *)x, x->x_bindsym);
if (!commentsink)
......
......@@ -362,7 +362,7 @@ static void pv_objstatus(t_pv *x, t_glist *glist)
(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("%zx owning patcher [%s]", (t_int)g, glist->gl_name->s_name);
post("%zx owning patcher [%s]", (t_uint)g, glist->gl_name->s_name);
}
}
......
......@@ -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%zx", (t_int)pd_class(&x->x_obj.te_pd));
sprintf(key2, "x%zx", (t_int)pd_class(&x->x_obj.te_pd));
sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd));
sprintf(key2, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd));
strcat(key, key2);
strcat(key, "default");
//x->x_image = gensym("::moonlib::image::noimage");
......@@ -90,7 +90,7 @@ static void image_drawme(t_image *x, t_glist *glist, int firsttime)
}
else
{
sprintf(key, "x%zx", (t_int)x);
sprintf(key, "x%zx", (t_uint)x);
const char *fname = image_get_filename(x, x->x_image->s_name);
if (!x->x_localimage)
{
......@@ -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%zx", (t_int)x);
sprintf(key, "x%zx", (t_uint)x);
x->x_image = gensym(fname);
x->x_key = gensym(key);
x->x_type = 0;
......@@ -327,7 +327,7 @@ static void image_load(t_gobj *z, t_symbol *image, t_symbol *file)
// x, image->s_name, fname);
/* For these class-accessible names, we prefix the user-provided
name with a class pointer. */
sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd));
sprintf(key, "x%zx", (t_uint)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,7 +343,7 @@ 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%zx", (t_int)pd_class(&x->x_obj.te_pd));
sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd));
strcat(key, image->s_name);
x->x_image = image;
x->x_key = gensym(key);
......@@ -394,7 +394,7 @@ static void *image_new(t_symbol *image, t_float type)
{
if (x->x_type)
{
sprintf(key, "x%zx", (t_int)pd_class(&x->x_obj.te_pd));
sprintf(key, "x%zx", (t_uint)pd_class(&x->x_obj.te_pd));
strcat(key, image->s_name);
x->x_image = image;
x->x_key = gensym(key);
......@@ -439,8 +439,8 @@ void image_setup(void)
of moonlib/image */
char key[MAXPDSTRING];
char key2[MAXPDSTRING];
sprintf(key, "x%zx", (t_int)image_class);
sprintf(key2, "x%zx", (t_int)image_class);
sprintf(key, "x%zx", (t_uint)image_class);
sprintf(key2, "x%zx", (t_uint)image_class);
strcat(key, key2);
strcat(key, "default");
gui_vmess("gui_load_default_image", "ss", "dummy", key);
......
......@@ -57,7 +57,7 @@ static void *folderpanel_new( void)
{
char buf[50];
t_folderpanel *x = (t_folderpanel *)pd_new(folderpanel_class);
sprintf(buf, "d%zx", (t_int)x);
sprintf(buf, "d%zx", (t_uint)x);
x->x_s = gensym(buf);
pd_bind(&x->x_obj.ob_pd, x->x_s);
outlet_new(&x->x_obj, &s_symbol);
......
......@@ -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, "%zx_a", (t_int)x);
sprintf(image_key, "%zx_a", (t_uint)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, "%zx_b", (t_int)x);
sprintf(image_key, "%zx_b", (t_uint)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, "%zx_a", (t_int)x);
sprintf(key_a, "%zx_a", (t_uint)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, "%zx_b", (t_int)x);
sprintf(key_b, "%zx_b", (t_uint)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, "%zx_a", (t_int)x);
sprintf(key_a, "%zx_a", (t_uint)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, "%zx_a", (t_int)x);
sprintf(key_b, "%zx_b", (t_int)x);
sprintf(key_a, "%zx_a", (t_uint)x);
sprintf(key_b, "%zx_b", (t_uint)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, "%zx_a", (t_int)x);
sprintf(key_a, "%zx_a", (t_uint)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, "%zx_b", (t_int)x);
sprintf(key_b, "%zx_b", (t_uint)x);
// Get image file path
fname = imagebang_get_filename(x,image_b->s_name);
......
......@@ -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%zx put {%s} -to %d 0\n", (t_int)x, x->x_gifdata, (bnumber*x->x_zoom)+i );
sprintf( x->x_guicommand, "COOLEDIMAGE%zx put {%s} -to %d 0\n", (t_uint)x, x->x_gifdata, (bnumber*x->x_zoom)+i );
if ( glist_isvisible( x->x_glist ) )
sys_gui( x->x_guicommand );
}
......
......@@ -944,15 +944,15 @@ t_scalehandle *scalehandle_new(t_object *x, t_glist *glist, int scale,
h->h_glist = glist;
if (!scale) /* Only bind for labels-- scaling uses pd_vmess in g_editor.c */
{
sprintf(buf, "_l%zx", (t_int)x);
sprintf(buf, "_l%zx", (t_uint)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%zx", (t_int)x);
sprintf(buf, "_s%zx", (t_uint)x);
pd_bind((t_pd *)h, h->h_bindsym = gensym(buf));
}
sprintf(h->h_outlinetag, "h%zx", (t_int)h);
sprintf(h->h_outlinetag, "h%zux", (t_uint)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%zx.h%zx", (t_int)h->h_glist, (t_int)h);
sprintf(h->h_pathname, ".x%zx.h%zx", (t_uint)h->h_glist, (t_uint)h);
h->h_clickfn = chf;
h->h_motionfn = mhf;
return h;
......
......@@ -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%zx owner=.x%zx\n", (t_int)x, (t_int)x->gl_owner);
//fprintf(stderr,"loading = 1 .x%zx owner=.x%zx\n", (t_uint)x, (t_uint)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 %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);
//fprintf(stderr,"draw_gop_resize_hooks DRAW %zx %zx\n", (t_uint)x, (t_uint)glist_getcanvas(x));
sprintf(sh->h_pathname, ".x%zx.h%zx", (t_uint)x, (t_uint)sh);
sprintf(mh->h_pathname, ".x%zx.h%zx", (t_uint)x, (t_uint)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 %zx %f\n", (t_int)x, f);
//fprintf(stderr,"canvas_map %zx %f\n", (t_uint)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 %zx\n", (t_int)x);
//fprintf(stderr,"canvas_redraw %zx\n", (t_uint)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%zx\n", (t_int)x);
//sys_vgui("focus .x%zx\n", (t_uint)x);
}
}
else
......@@ -1032,7 +1032,7 @@ extern void canvas_group_free(t_pd *x);
void canvas_free(t_canvas *x)
{
//fprintf(stderr,"canvas_free %zx\n", (t_int)x);
//fprintf(stderr,"canvas_free %zx\n", (t_uint)x);
t_gobj *y;
int dspstate = canvas_suspend_dsp();
......@@ -1143,7 +1143,7 @@ void canvas_eraselinesfor(t_canvas *x, t_text *text)
if (x->gl_editor)
{
char tagbuf[MAXPDSTRING];
sprintf(tagbuf, "l%zx", (t_int)oc);
sprintf(tagbuf, "l%zx", (t_uint)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%zx", (t_int)oc);
sprintf(buf, "l%zx", (t_uint)oc);
gui_vmess("gui_canvas_delete_line", "xs",
glist_getcanvas(x),
buf);
......@@ -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%zx\n", (t_int)z);
//fprintf(stderr,"subcanvas_new current canvas .x%zx\n", (t_uint)z);
if (!*s->s_name) s = gensym("/SUBPATCH/");
SETFLOAT(a, 0);
SETFLOAT(a+1, GLIST_DEFCANVASYLOC);
......@@ -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%zx .x%zx\n", (t_int)g, (t_int)x);
//fprintf(stderr,"same canvas .x%zx .x%zx\n", (t_uint)g, (t_uint)x);
}
if ((ob = pd_checkobject(&g->g_pd)) || pd_class(&g->g_pd) == canvas_class)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment