Changeset 180
- Timestamp:
- 03/18/14 09:11:39 (11 years ago)
- Location:
- cpp
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/framsg.cpp
r122 r180 5 5 #include "framsg.h" 6 6 #include <common/nonstd_stdio.h> 7 #include "stl-util.h" 7 8 #include "Convert.h" 8 9 … … 11 12 void FMprintf_va(const char *o,const char *m,int w,const char *bl,va_list va) 12 13 { 13 char buf[10000]; 14 vsnprintf(buf,10000,bl,va); 15 FramMessage(o,m,buf,w); 14 string buf=ssprintf_va(bl,va); 15 FramMessage(o,m,buf.c_str(),w); 16 16 } 17 17 -
cpp/common/stl-util.h
r140 r180 7 7 8 8 #include "nonstd_stl.h" 9 #include <stdarg.h> 9 10 10 11 template<typename T, std::size_t N> void push_back(vector<T>& v, T(&d)[N]) … … 37 38 38 39 string ssprintf(const char* format, ...); 40 string ssprintf_va(const char* format, va_list ap); 39 41 40 42 string stripExt(const string& filename); // strip extension from filename 43 string getFileExt(const string& filename); // get extension (starting with ".") from filename 41 44 42 45 bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file=true); -
cpp/frams/Makefile-GDK-files
r174 r180 4 4 ALL_DIRS={common,frams,frams/canvas,frams/config,frams/errmgr,frams/genetics,frams/genetics/f0,frams/genetics/f1,frams/genetics/f2,frams/genetics/f3,frams/genetics/f4,frams/genetics/f5,frams/genetics/f6,frams/genetics/f7,frams/genetics/f8,frams/genetics/f9,frams/genetics/fF,frams/model,frams/neuro,frams/neuro/impl,frams/param,frams/test,frams/util,frams/vm/classes,frams/virtfile,frams/_demos} 5 5 6 GENOCONV_GDK_OBJS=frams/genetics/defgenoconv.o frams/genetics/f1/conv_f1.o frams/genetics/f9/conv_f9.o frams/genetics/fF/conv_fF.o frams/genetics/fF/fF_genotype.o frams/genetics/fF/fF_chamber3d.o 6 GENOCONV_GDK_OBJS=frams/genetics/defgenoconv.o frams/genetics/f1/conv_f1.o frams/genetics/f9/conv_f9.o frams/genetics/fF/conv_fF.o frams/genetics/fF/fF_genotype.o frams/genetics/fF/fF_chamber3d.o 7 7 8 8 GENMAN_COMMON_OBJS=frams/genetics/genman.o frams/param/mutableparam.o frams/param/mutparamlist.o frams/neuro/geneticneuroparam.o frams/neuro/neurolibparam.o frams/vm/classes/genoobj.o frams/model/autoname.o 9 9 GENMAN_GDK_OBJS=$(GENMAN_COMMON_OBJS) frams/genetics/f9/oper_f9.o frams/genetics/fF/oper_fF.o 10 10 11 GDK_OBJS=frams/util/list.o frams/util/advlist.o frams/param/param.o frams/util/sstring.o frams/util/sstringutils.o frams/util/3d.o frams/vm/classes/3dobject.o frams/model/model.o frams/model/modelparts.o frams/neuro/neurolibrary.o frams/genetics/geno.o frams/genetics/genoconv.o frams/util/extvalue.o frams/vm/classes/collectionobj.o frams/util/hashtable.o common/framsg.o frams/util/callbacks.o frams/param/syntparam.o frams/util/multirange.o frams/util/multimap.o frams/param/paramtabobj.o frams/errmgr/errmanager.o frams/param/paramobj.o frams/genetics/oper_fx.o common/nonstd_math.o frams/errmgr/stderrors.o common/Convert.o frams/util/rndutil.o11 GDK_OBJS=frams/util/list.o frams/util/advlist.o frams/param/param.o frams/util/sstring.o frams/util/sstringutils.o frams/util/3d.o frams/vm/classes/3dobject.o frams/model/model.o frams/model/modelparts.o frams/neuro/neurolibrary.o frams/genetics/geno.o frams/genetics/genoconv.o frams/util/extvalue.o frams/vm/classes/collectionobj.o frams/util/hashtable.o common/framsg.o common/stl-util.o frams/util/callbacks.o frams/param/syntparam.o frams/util/multirange.o frams/util/multimap.o frams/param/paramtabobj.o frams/errmgr/errmanager.o frams/param/paramobj.o frams/genetics/oper_fx.o common/nonstd_math.o frams/errmgr/stderrors.o common/Convert.o frams/util/rndutil.o 12 12 13 13 -
cpp/frams/errmgr/errmanager.cpp
r121 r180 4 4 5 5 #include "errmanager.h" 6 6 #include <common/stl-util.h> 7 7 8 8 void FramMessage(const char *o,const char *m,const char *bl,int w) … … 65 65 { 66 66 if (!isEnabled()) return; 67 char buf[10000];67 string buf; 68 68 va_list argptr; 69 69 va_start(argptr,bl); 70 vsnprintf(buf,10000,bl,argptr);70 buf=ssprintf_va(bl,argptr); 71 71 va_end(argptr); 72 send(o,m,buf ,w);72 send(o,m,buf.c_str(),w); 73 73 } 74 74 -
cpp/frams/genetics/genoconv.cpp
r150 r180 15 15 #include "genoconv.h" 16 16 #include <frams/util/multimap.h> 17 #include <common/stl-util.h> 17 18 18 19 /////////////////////////////////////////////////////////////////////////// … … 189 190 if (!tmp.len()) 190 191 { 191 char t[100]; 192 sprintf(t, "f%c->f%c conversion failed (%s)", gk->in_format, gk->out_format, gk->name); 193 return Geno(0, 0, 0, t); 192 string t=ssprintf("f%c->f%c conversion failed (%s)", gk->in_format, gk->out_format, gk->name); 193 return Geno(0, 0, 0, t.c_str()); 194 194 } 195 195 if (mapavail)
Note: See TracChangeset
for help on using the changeset viewer.