ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.59 by ats, Sat Nov 6 14:55:53 2004 UTC vs.
Revision 1.61 by tdb, Sat Nov 6 23:54:12 2004 UTC

# Line 234 | Line 234 | static int build_mapping(){
234                          if(strcmp(ksp->ks_module, "md")==0) continue;
235                          if((kstat_read(kc, ksp, &kios))==-1) continue;
236                          strncpy(device_name, ksp->ks_name, sizeof device_name);
237 <                        for(x=0;x<(sizeof device_name);x++){
237 >                        for(x=0;x<(int)(sizeof device_name);x++){
238                                  if( isdigit((int)device_name[x]) ) break;
239                          }
240                          if(x == sizeof device_name) x--;
# Line 294 | Line 294 | char *sg_get_string_match(char *line, regmatch_t *matc
294          return match_string;
295   }
296  
297 < long long sg_get_ll_match(char *line, regmatch_t *match){
298 <        char *ptr;
299 <        long long num;
300 <
301 <        ptr=line+match->rm_so;
302 <        num=atoll(ptr);
303 <
304 <        return num;
305 < }
306 < #endif
307 <
297 > /* FIXME do Linux and Cygwin always have atoll? */
298   #ifndef HAVE_ATOLL
299   static long long atoll(const char *s) {
300          long long value = 0;
# Line 322 | Line 312 | static long long atoll(const char *s) {
312                  s++;
313          }
314          return (isneg ? -value : value);
315 + }
316 + #endif
317 +
318 + long long sg_get_ll_match(char *line, regmatch_t *match){
319 +        char *ptr;
320 +        long long num;
321 +
322 +        ptr=line+match->rm_so;
323 +        num=atoll(ptr);
324 +
325 +        return num;
326   }
327   #endif
328  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines