Changeset 5793

Show
Ignore:
Timestamp:
11/04/09 20:07:38 (4 years ago)
Author:
andy
Message:

sensord: Change signature of (*FeatureFN)

This patch changes the signature of function pointer (*FeatureFN) and
the related functions:

rrdGetSensors_DS()
rrdCGI_DEF()
rrdCGI_LINE()

Return type is now void because none of the functions return an error
code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/sensord/rrd.c

    r5792 r5793  
    6969#define LOAD_AVERAGE "Load Average" 
    7070 
    71 typedef int (*FeatureFN) (void *data, const char *rawLabel, const char *label, 
    72                           const FeatureDescriptor *feature); 
     71typedef void (*FeatureFN) (void *data, const char *rawLabel, const char *label, 
     72                           const FeatureDescriptor *feature); 
    7373 
    7474static char rrdNextChar(char c) 
     
    142142                            const ChipDescriptor *desc) 
    143143{ 
    144         int i, ret; 
     144        int i; 
    145145        const FeatureDescriptor *features = desc->features; 
    146146        const FeatureDescriptor *feature; 
     
    160160 
    161161                rrdCheckLabel(rawLabel, i); 
    162                 ret = fn(data, rrdLabels[i], label, feature); 
     162                fn(data, rrdLabels[i], label, feature); 
    163163                free(label); 
    164164        } 
     
    211211}; 
    212212 
    213 static int rrdGetSensors_DS(void *_data, const char *rawLabel, 
    214                             const char *label, 
    215                             const FeatureDescriptor *feature) 
     213static void rrdGetSensors_DS(void *_data, const char *rawLabel, 
     214                             const char *label, 
     215                             const FeatureDescriptor *feature) 
    216216{ 
    217217        (void) label; /* no warning */ 
     
    248248                        sensord_args.rrdTime, min, max); 
    249249        } 
    250         return 0; 
    251250} 
    252251 
     
    257256        ret = applyToFeatures(rrdGetSensors_DS, &data); 
    258257        if (!ret && sensord_args.doLoad) 
    259                 ret = rrdGetSensors_DS(&data, LOADAVG, LOAD_AVERAGE, NULL); 
     258                rrdGetSensors_DS(&data, LOADAVG, LOAD_AVERAGE, NULL); 
    260259        return ret ? -1 : data.num; 
    261260} 
     
    324323}; 
    325324 
    326 static int rrdCGI_DEF(void *_data, const char *rawLabel, const char *label, 
    327                       const FeatureDescriptor *feature) 
     325static void rrdCGI_DEF(void *_data, const char *rawLabel, const char *label, 
     326                       const FeatureDescriptor *feature) 
    328327{ 
    329328        struct gr *data = _data; 
     
    332331                printf("\n\tDEF:%s=%s:%s:AVERAGE", rawLabel, 
    333332                       sensord_args.rrdFile, rawLabel); 
    334         return 0; 
    335333} 
    336334 
     
    360358} 
    361359 
    362 static int rrdCGI_LINE(void *_data, const char *rawLabel, const char *label, 
    363                        const FeatureDescriptor *feature) 
     360static void rrdCGI_LINE(void *_data, const char *rawLabel, const char *label, 
     361                        const FeatureDescriptor *feature) 
    364362{ 
    365363        struct gr *data = _data; 
     
    367365                printf("\n\tLINE2:%s#%.6x:\"%s\"", rawLabel, 
    368366                       rrdCGI_color(label), label); 
    369         return 0; 
    370367} 
    371368 
     
    489486                        ret = applyToFeatures(rrdCGI_DEF, graph); 
    490487                if (!ret && sensord_args.doLoad && graph->loadAvg) 
    491                         ret = rrdCGI_DEF(graph, LOADAVG, LOAD_AVERAGE, NULL); 
     488                        rrdCGI_DEF(graph, LOADAVG, LOAD_AVERAGE, NULL); 
    492489                if (!ret) 
    493490                        ret = applyToFeatures(rrdCGI_LINE, graph); 
    494491                if (!ret && sensord_args.doLoad && graph->loadAvg) 
    495                         ret = rrdCGI_LINE(graph, LOADAVG, LOAD_AVERAGE, NULL); 
     492                        rrdCGI_LINE(graph, LOADAVG, LOAD_AVERAGE, NULL); 
    496493                printf (">\n</p>\n"); 
    497494        }