Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16787
Modified Files:
Tag: branch-v0-40-extended
d_soundfile.c g_array.c g_canvas.c m_pd.h
Log Message:
checked in patch #1841002 from Russell Bryant: added error checking to functions with fmt...
Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.16.2.2.2.2
retrieving revision 1.16.2.2.2.3
diff -C2 -d -r1.16.2.2.2.2 -r1.16.2.2.2.3
*** m_pd.h 25 Nov 2007 03:31:05 -0000 1.16.2.2.2.2
--- m_pd.h 29 Nov 2007 18:24:39 -0000 1.16.2.2.2.3
***************
*** 465,472 ****
EXTERN void postatom(int argc, t_atom *argv);
EXTERN void endpost(void);
! EXTERN void error(const char *fmt, ...);
! EXTERN void verbose(int level, const char *fmt, ...);
! EXTERN void bug(const char *fmt, ...);
! EXTERN void pd_error(void *object, const char *fmt, ...);
EXTERN void sys_logerror(const char *object, const char *s);
EXTERN void sys_unixerror(const char *object);
--- 465,472 ----
EXTERN void postatom(int argc, t_atom *argv);
EXTERN void endpost(void);
! EXTERN void error(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
! EXTERN void verbose(int level, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
! EXTERN void bug(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
! EXTERN void pd_error(void *object, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
EXTERN void sys_logerror(const char *object, const char *s);
EXTERN void sys_unixerror(const char *object);
Index: g_array.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_array.c,v
retrieving revision 1.11
retrieving revision 1.11.6.1
diff -C2 -d -r1.11 -r1.11.6.1
*** g_array.c 15 Aug 2006 04:54:15 -0000 1.11
--- g_array.c 29 Nov 2007 18:24:38 -0000 1.11.6.1
***************
*** 1137,1146 ****
if (!a)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return (0);
}
else if (elemsize != sizeof(t_word))
{
! error("%s: has more than one field", x->x_realname);
return (0);
}
--- 1137,1146 ----
if (!a)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return (0);
}
else if (elemsize != sizeof(t_word))
{
! error("%s: has more than one field", x->x_realname->s_name);
return (0);
}
***************
*** 1165,1169 ****
t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize);
if (!array)
! error("%s: needs floating-point 'y' field", x->x_realname);
else for (i = 0; i < array->a_n; i++)
*((float *)((char *)array->a_vec
--- 1165,1169 ----
t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize);
if (!array)
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
else for (i = 0; i < array->a_n; i++)
*((float *)((char *)array->a_vec
***************
*** 1181,1185 ****
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return;
}
--- 1181,1185 ----
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return;
}
***************
*** 1260,1264 ****
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return;
}
--- 1260,1264 ----
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return;
}
***************
*** 1295,1299 ****
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return;
}
--- 1295,1299 ----
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return;
}
***************
*** 1376,1380 ****
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return;
}
--- 1376,1380 ----
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return;
}
***************
*** 1412,1416 ****
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname);
return;
}
--- 1412,1416 ----
if (!array)
{
! error("%s: needs floating-point 'y' field", x->x_realname->s_name);
return;
}
Index: g_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.18.6.3
retrieving revision 1.18.6.4
diff -C2 -d -r1.18.6.3 -r1.18.6.4
*** g_canvas.c 10 Nov 2007 04:50:17 -0000 1.18.6.3
--- g_canvas.c 29 Nov 2007 18:24:39 -0000 1.18.6.4
***************
*** 159,163 ****
while (!x->gl_env)
if (!(x = x->gl_owner))
! bug("t_canvasenvironment", x);
return (x->gl_env);
}
--- 159,163 ----
while (!x->gl_env)
if (!(x = x->gl_owner))
! bug("t_canvasenvironment");
return (x->gl_env);
}
Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.12.6.1
retrieving revision 1.12.6.2
diff -C2 -d -r1.12.6.1 -r1.12.6.2
*** d_soundfile.c 4 Nov 2007 18:00:20 -0000 1.12.6.1
--- d_soundfile.c 29 Nov 2007 18:24:38 -0000 1.12.6.2
***************
*** 761,765 ****
{
if (nframes < 0x7fffffff)
! pd_error(obj, "soundfiler_write: %d out of %d bytes written",
itemswritten, nframes);
/* try to fix size fields in header */
--- 761,765 ----
{
if (nframes < 0x7fffffff)
! pd_error(obj, "soundfiler_write: %ld out of %ld bytes written",
itemswritten, nframes);
/* try to fix size fields in header */
***************
*** 1091,1095 ****
if (framesinfile > maxsize)
{
! pd_error(x, "soundfiler_read: truncated to %d elements", maxsize);
framesinfile = maxsize;
}
--- 1091,1095 ----
if (framesinfile > maxsize)
{
! pd_error(x, "soundfiler_read: truncated to %ld elements", maxsize);
framesinfile = maxsize;
}