Changeset 3572 in Sophya for trunk/SophyaLib/SUtils
- Timestamp:
- Feb 7, 2009, 10:50:34 PM (17 years ago)
- Location:
- trunk/SophyaLib/SUtils
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SUtils/datacards.cc
r2615 r3572 1 1 // 2 // $Id: datacards.cc,v 1.1 0 2004-09-10 09:54:48cmv Exp $2 // $Id: datacards.cc,v 1.11 2009-02-07 21:49:59 cmv Exp $ 3 3 // 4 4 // … … 217 217 DataCards::GetKey(int num) const 218 218 { 219 if ((num < 0) || (num >= cards.size()) ) return("");219 if ((num < 0) || (num >= (int)cards.size()) ) return(""); 220 220 int k = 0; 221 221 CardList::const_iterator i; … … 234 234 DataCards::CardList::const_iterator it = FindKeyC(key); 235 235 if (it == cards.end()) return(rs); 236 for ( int k=0; k<(*it).tokens.size(); k++) {236 for (size_t k=0; k<(*it).tokens.size(); k++) { 237 237 rs += ' '; rs += (*it).tokens[k]; 238 238 } … … 246 246 DataCards::CardList::const_iterator it = FindKeyC(key); 247 247 if (it == cards.end()) return(def); 248 if ( (numero < 0) || (numero >= ( *it).tokens.size()) ) return def;248 if ( (numero < 0) || (numero >= (int)((*it).tokens.size())) ) return def; 249 249 return (*it).tokens[numero]; 250 250 } … … 308 308 DataCards::ApplyPF(CrdPF & cpf, string const& key, string const& toks) 309 309 { 310 int l,lk;310 size_t l,lk; 311 311 int rc = 0; 312 312 // On verifie si le "pattern" correspond -
trunk/SophyaLib/SUtils/strutilxx.cc
r2706 r3572 13 13 // considering char "sep" as a separator. 14 14 // Vector is filled from its end (no reset done). 15 // T pwrite a "sep" char, use \'sep'15 // To write a "sep" char, use \'sep' 16 16 // Warning: separator "sep" could not be set to '\' 17 17 // Ex: sep=' ': s="aaa bbb cc d " -> vs=(aaa,bbb,cc,d) … … 55 55 // - Fill "vs" at the end: NO RESET IS DONE 56 56 // - If ',' is the separator, ",,," is c 57 // That routine is much more rapid than FillVStringFrString alt ouch less general57 // That routine is much more rapid than FillVStringFrString although less general 58 58 // (ex no '\' gestion is done) 59 59 { 60 60 uint_4 ls = s.size(); 61 61 if(ls<=0) return; 62 bool sep_non_blanc = (separator==' ')? false: true;62 //bool sep_non_blanc = (separator==' ')? false: true; 63 63 char *str = new char[ls+2]; 64 64 -
trunk/SophyaLib/SUtils/utils.cc
r2615 r3572 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: utils.cc,v 1. 2 2004-09-10 09:54:49 cmv Exp $3 // $Id: utils.cc,v 1.3 2009-02-07 21:49:59 cmv Exp $ 4 4 // 5 5 … … 15 15 int i; // THINK C ne veut pas du int i dans chaque for... 16 16 if (dest < source) 17 for (i=0; i< n; i++)17 for (i=0; i<(int)n; i++) 18 18 ((char*)dest)[i] = ((char*)source)[i]; 19 19 else
Note:
See TracChangeset
for help on using the changeset viewer.