Update of /cvsroot/pure-data/externals/grill/flext/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12192/source
Modified Files: flatom_pr.cpp flstdc.h flsupport.cpp flsupport.h Log Message: ""
Index: flstdc.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flstdc.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** flstdc.h 8 Feb 2004 03:36:25 -0000 1.19 --- flstdc.h 26 Mar 2004 03:22:11 -0000 1.20 *************** *** 112,116 **** typedef t_object *t_thing;
! typedef qelem t_qelem;
typedef method t_method; --- 112,116 ---- typedef t_object *t_thing;
! typedef void *t_qelem;
typedef method t_method;
Index: flsupport.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** flsupport.cpp 23 Mar 2004 03:22:38 -0000 1.33 --- flsupport.cpp 26 Mar 2004 03:22:11 -0000 1.34 *************** *** 19,22 **** --- 19,27 ---- #include <new>
+ #ifdef _MSC_VER + #define vsnprintf _vsnprintf + #define snprintf _snprintf + #endif + const t_symbol *flext::sym_float = NULL; const t_symbol *flext::sym_symbol = NULL; *************** *** 264,271 **** atom_string(const_cast<t_atom *>(&a),buf,szbuf); #else ! // no checking for size here ! if(IsSymbol(a)) STD::sprintf(buf,GetString(a)); ! else if(IsFloat(a)) STD::sprintf(buf,"%f",GetFloat(a)); ! else if(IsInt(a)) STD::sprintf(buf,"%i",GetInt(a)); else *buf = 0; #endif --- 269,275 ---- atom_string(const_cast<t_atom *>(&a),buf,szbuf); #else ! if(IsSymbol(a)) STD::strncpy(buf,GetString(a),szbuf); ! else if(IsFloat(a)) STD::snprintf(buf,szbuf,"%f",GetFloat(a)); ! else if(IsInt(a)) STD::snprintf(buf,szbuf,"%i",GetInt(a)); else *buf = 0; #endif *************** *** 281,285 **** }
- void flext_root::post(const char *fmt, ...) { --- 285,288 ---- *************** *** 287,292 **** va_start(ap, fmt);
! char buf[1024]; // \TODO this is quite unsafe..... ! vsprintf(buf, fmt, ap); ::post(buf);
--- 290,296 ---- va_start(ap, fmt);
! char buf[1024]; ! vsnprintf(buf,sizeof buf,fmt, ap); ! buf[sizeof buf-1] = 0; // in case of full buffer ::post(buf);
*************** *** 299,305 **** va_start(ap, fmt);
! char buf[1024]; // \TODO this is quite unsafe..... ! STD::sprintf(buf,"error: "); ! vsprintf(buf+7, fmt, ap); ::post(buf);
--- 303,310 ---- va_start(ap, fmt);
! char buf[1024]; ! strcpy(buf,"error: "); ! vsnprintf(buf+7,sizeof buf-7,fmt, ap); ! buf[sizeof buf-1] = 0; // in case of full buffer ::post(buf);
Index: flsupport.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** flsupport.h 6 Mar 2004 03:25:48 -0000 1.65 --- flsupport.h 26 Mar 2004 03:22:11 -0000 1.66 *************** *** 36,43 **** // --- console output -----------------------------------------------
! //! post message to console ! static void post(const char *s,...); ! //! post error message to console ! static void error(const char *s,...);
// --- memory ------------------------------------------------------- --- 36,43 ---- // --- console output -----------------------------------------------
! //! post message to console, with line feed (limited to 1k chars!) ! static void post(const char *fmt,...); ! //! post error message to console (limited to 1k chars!) ! static void error(const char *fmt,...);
// --- memory ------------------------------------------------------- *************** *** 568,572 ****
//! Represent as a string ! bool Print(char *buffer,int buflen) const;
protected: --- 568,572 ----
//! Represent as a string ! bool Print(char *buffer,int buflen) const { return flext::PrintList(Count(),Atoms(),buffer,buflen); }
protected:
Index: flatom_pr.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flatom_pr.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** flatom_pr.cpp 8 Feb 2004 03:36:25 -0000 1.16 --- flatom_pr.cpp 26 Mar 2004 03:22:11 -0000 1.17 *************** *** 19,22 **** --- 19,26 ---- #include <stdio.h>
+ #ifdef _MSC_VER + #define snprintf _snprintf + #endif + // \TODO take bufsz into account! bool flext::PrintAtom(const t_atom &a,char *buf,int bufsz) *************** *** 24,50 **** bool ok = true; if(IsFloat(a)) { ! STD::sprintf(buf,"%g",GetFloat(a)); } else if(IsInt(a)) { ! STD::sprintf(buf,"%i",GetInt(a)); } else if(IsSymbol(a)) { if(!FLEXT_ASSERT(GetSymbol(a))) *buf = 0; else ! STD::strcpy(buf,GetString(a)); } else if(IsPointer(a)) { ! STD::sprintf(buf,"%p",GetPointer(a)); } #if FLEXT_SYS == FLEXT_SYS_PD else if(a.a_type == A_DOLLAR) { ! STD::sprintf(buf,"$%d",a.a_w.w_index); } else if(a.a_type == A_DOLLSYM) { ! STD::sprintf(buf,"$%s",GetString(a)); } #elif FLEXT_SYS == FLEXT_SYS_MAX else if(a.a_type == A_DOLLAR) { ! STD::sprintf(buf,"$%d",a.a_w.w_long); } #else --- 28,54 ---- bool ok = true; if(IsFloat(a)) { ! STD::snprintf(buf,bufsz,"%g",GetFloat(a)); } else if(IsInt(a)) { ! STD::snprintf(buf,bufsz,"%i",GetInt(a)); } else if(IsSymbol(a)) { if(!FLEXT_ASSERT(GetSymbol(a))) *buf = 0; else ! STD::strncpy(buf,GetString(a),bufsz); } else if(IsPointer(a)) { ! STD::snprintf(buf,bufsz,"%p",GetPointer(a)); } #if FLEXT_SYS == FLEXT_SYS_PD else if(a.a_type == A_DOLLAR) { ! STD::snprintf(buf,bufsz,"$%d",a.a_w.w_index); } else if(a.a_type == A_DOLLSYM) { ! STD::snprintf(buf,bufsz,"$%s",GetString(a)); } #elif FLEXT_SYS == FLEXT_SYS_MAX else if(a.a_type == A_DOLLAR) { ! STD::snprintf(buf,bufsz,"$%d",a.a_w.w_long); } #else *************** *** 75,83 **** }
- bool flext::AtomList::Print(char *buffer,int buflen) const - { - return flext::PrintList(Count(),Atoms(),buffer,buflen); - } -
bool flext::ScanAtom(t_atom &a,const char *buf) --- 79,82 ----