[PD-cvs] SF.net SVN: pure-data:[10179] branches/pd-extended/v0-40/externals/bbogart/ entry/entry.c
eighthave at users.sourceforge.net
eighthave at users.sourceforge.net
Sat Jul 19 00:49:31 CEST 2008
Revision: 10179
http://pure-data.svn.sourceforge.net/pure-data/?rev=10179&view=rev
Author: eighthave
Date: 2008-07-18 22:49:31 +0000 (Fri, 18 Jul 2008)
Log Message:
-----------
added 1 byte to getbytes() since GNU/Linux needs the strings to have a NULL character at the end, while Mac OS X apparently doesn't
Modified Paths:
--------------
branches/pd-extended/v0-40/externals/bbogart/entry/entry.c
Modified: branches/pd-extended/v0-40/externals/bbogart/entry/entry.c
===================================================================
--- branches/pd-extended/v0-40/externals/bbogart/entry/entry.c 2008-07-18 19:34:03 UTC (rev 10178)
+++ branches/pd-extended/v0-40/externals/bbogart/entry/entry.c 2008-07-18 22:49:31 UTC (rev 10179)
@@ -48,8 +48,8 @@
#define TOTAL_INLETS 1
#define TOTAL_OUTLETS 2
-#define DEBUG(x)
-//#define DEBUG(x) x
+//#define DEBUG(x)
+#define DEBUG(x) x
typedef struct _entry
{
@@ -134,32 +134,32 @@
/* Tk ID for the current canvas that this object is drawn in */
sprintf(buf,".x%lx.c", (long unsigned int) canvas);
- x->canvas_id = getbytes(strlen(buf));
+ 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);
- x->frame_id = getbytes(strlen(buf));
+ x->frame_id = getbytes(strlen(buf) + 1);
strcpy(x->frame_id, buf);
sprintf(buf,"%s.text%lx", x->frame_id, (long unsigned int)x);
- x->text_id = getbytes(strlen(buf));
+ 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);
- x->window_tag = getbytes(strlen(buf));
+ 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);
- x->handle_id = getbytes(strlen(buf));
+ 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);
- x->scrollbar_id = getbytes(strlen(buf));
+ 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);
- x->all_tag = getbytes(strlen(buf));
+ x->all_tag = getbytes(strlen(buf) + 1);
strcpy(x->all_tag, buf); /* Tk ID for the optional "scrollbar" */
}
@@ -744,8 +744,8 @@
x->x_font_weight = gensym("normal");
x->x_have_scrollbar = 0;
x->x_selected = 0;
-
- if (argc < 4)
+
+ if (argc < 4)
{
post("entry: You must enter at least 4 arguments. Default values used.");
x->x_width = ENTRY_DEFAULT_WIDTH;
@@ -759,13 +759,13 @@
x->x_height = atom_getint(argv+1);
x->x_bgcolour = atom_getsymbol(argv+2);
x->x_fgcolour = atom_getsymbol(argv+3);
- }
+ }
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);
- x->tcl_namespace = getbytes(strlen(buf));
+ x->tcl_namespace = getbytes(strlen(buf) + 1);
strcpy(x->tcl_namespace, buf);
sprintf(buf,"#%s", x->tcl_namespace);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Pd-cvs
mailing list