Changeset 732

Show
Ignore:
Timestamp:
02/07/00 04:16:03 (15 years ago)
Author:
mds
Message:

(mds) -Wall cleanup.

Location:
lm-sensors/trunk/prog/sensord
Files:
2 modified

Legend:

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

    r661 r732  
    9090/** LM75 **/ 
    9191 
    92 static char *lm75_names[] = { 
     92static const char *lm75_names[] = { 
    9393  SENSORS_LM75_PREFIX, NULL 
    9494}; 
     
    102102/** ADM1021 **/ 
    103103 
    104 static char *adm1021_names[] = { 
     104static const char *adm1021_names[] = { 
    105105  SENSORS_ADM1021_PREFIX, NULL 
    106106}; 
     
    118118/** MAX1617 **/ 
    119119 
    120 static char *max1617_names[] = { 
     120static const char *max1617_names[] = { 
    121121  SENSORS_MAX1617_PREFIX, SENSORS_MAX1617A_PREFIX, SENSORS_THMC10_PREFIX, SENSORS_LM84_PREFIX, SENSORS_GL523_PREFIX, NULL 
    122122}; 
     
    132132/** ADM9240 **/ 
    133133 
    134 static char *adm9240_names[] = { 
     134static const char *adm9240_names[] = { 
    135135  SENSORS_ADM9240_PREFIX, SENSORS_DS1780_PREFIX, SENSORS_LM81_PREFIX, NULL 
    136136}; 
     
    162162/** SIS5595 **/ 
    163163 
    164 static char *sis5595_names[] = { 
     164static const char *sis5595_names[] = { 
    165165  SENSORS_SIS5595_PREFIX, NULL 
    166166}; 
     
    186186/** LM78 **/ 
    187187 
    188 static char *lm78_names[] = { 
     188static const char *lm78_names[] = { 
    189189  SENSORS_LM78_PREFIX, SENSORS_LM78J_PREFIX, SENSORS_LM79_PREFIX, /*"sis5595",*/ NULL 
    190190}; 
     
    220220/** GL518 **/ 
    221221 
    222 static char *gl518_names[] = { 
     222static const char *gl518_names[] = { 
    223223  SENSORS_GL518_PREFIX, NULL 
    224224}; 
     
    251251} 
    252252 
    253 static char *lm80_names[] = { 
     253static const char *lm80_names[] = { 
    254254  SENSORS_LM80_PREFIX, NULL 
    255255}; 
     
    281281/** W83781D **/ 
    282282 
    283 static char *w83781d_names[] = { 
     283static const char *w83781d_names[] = { 
    284284  SENSORS_W83781D_PREFIX, NULL 
    285285}; 
     
    328328} 
    329329 
    330 static char *w83782d_names[] = { 
     330static const char *w83782d_names[] = { 
    331331  SENSORS_W83782D_PREFIX, SENSORS_W83627HF_PREFIX, SENSORS_AS99127F_PREFIX, NULL 
    332332}; 
     
    368368/** W83783S **/ 
    369369 
    370 static char *w83783s_names[] = { 
     370static const char *w83783s_names[] = { 
    371371  SENSORS_W83783S_PREFIX, NULL 
    372372}; 
     
    413413} 
    414414 
    415 static char *maxilife_names[] = { 
     415static const char *maxilife_names[] = { 
    416416  SENSORS_MAXI_CG_PREFIX, SENSORS_MAXI_CO_PREFIX, SENSORS_MAXI_AS_PREFIX, NULL 
    417417}; 
  • lm-sensors/trunk/prog/sensord/sensord.c

    r703 r732  
    4040#include "sensord.h" 
    4141 
    42 static char *version = "0.2.0"; 
    43  
    44 static char *sensorsCfgPaths[] = { 
     42static const char *version = "0.2.0"; 
     43 
     44static const char *sensorsCfgPaths[] = { 
    4545  "/etc", "/usr/lib/sensors", "/usr/local/lib/sensors", "/usr/lib", "/usr/local/lib", NULL 
    4646}; 
    47 static char *sensorsCfgFile = "sensors.conf"; 
    48 static char *sensorsLogFile = "/var/log/sensors"; 
     47static const char *sensorsCfgFile = "sensors.conf"; 
     48static const char *sensorsLogFile = "/var/log/sensors"; 
    4949static int sleepTime = 5 * 60; 
    5050 
     
    8080 
    8181static char * 
    82 now 
     82nowf 
    8383(void) { 
    8484  time_t now; 
     
    129129(const sensors_chip_name *chip, ChipDescriptor *descriptor) { 
    130130  FeatureDescriptor *features = descriptor->features; 
    131   int index, subindex; 
    132   int ret = 0; 
    133  
    134   for (index = 0; !done && (ret == 0) && features[index].format; ++ index) { 
    135     FeatureDescriptor *feature = features + index; 
     131  int index0, subindex; 
     132  int ret = 0; 
     133 
     134  for (index0 = 0; !done && (ret == 0) && features[index0].format; ++ index0) { 
     135    FeatureDescriptor *feature = features + index0; 
    136136    char *label = NULL; 
    137137    double values[MAX_DATA]; 
     
    159159(const sensors_chip_name *chip) { 
    160160  const char *adapter, *algorithm; 
    161   int index, subindex, chipindex = -1; 
     161  int index0, subindex, chipindex = -1; 
    162162  int ret = 0; 
    163163 
    164164  if (chip->bus == SENSORS_CHIP_NAME_BUS_ISA) 
    165     fprintf (sensorsLog, "%s: Chip: %s-isa-%04x\n", now (), chip->prefix, chip->addr); 
     165    fprintf (sensorsLog, "%s: Chip: %s-isa-%04x\n", nowf(), chip->prefix, chip->addr); 
    166166  else 
    167     fprintf (sensorsLog, "%s: Chip: %s-i2c-%d-%02x\n", now (), chip->prefix, chip->bus, chip->addr); 
     167    fprintf (sensorsLog, "%s: Chip: %s-i2c-%d-%02x\n", nowf(), chip->prefix, chip->bus, chip->addr); 
    168168  adapter = sensors_get_adapter_name (chip->bus); 
    169169  if (adapter) 
    170     fprintf (sensorsLog, "%s: Adapter: %s\n", now (), adapter); 
     170    fprintf (sensorsLog, "%s: Adapter: %s\n", nowf(), adapter); 
    171171  algorithm = sensors_get_algorithm_name (chip->bus); 
    172172  if (algorithm) 
    173     fprintf (sensorsLog, "%s: Algorithm: %s\n", now (), algorithm); 
     173    fprintf (sensorsLog, "%s: Algorithm: %s\n", nowf(), algorithm); 
    174174  /* assert adapter || algorithm */ 
    175175 
    176   for (index = 0; knownChips[index].names; ++ index) 
    177     for (subindex = 0; knownChips[index].names[subindex]; ++ subindex) 
    178       if (!strcmp (chip->prefix, knownChips[index].names[subindex])) 
    179         chipindex = index; 
     176  for (index0 = 0; knownChips[index0].names; ++ index0) 
     177    for (subindex = 0; knownChips[index0].names[subindex]; ++ subindex) 
     178      if (!strcmp (chip->prefix, knownChips[index0].names[subindex])) 
     179        chipindex = index0; 
    180180   
    181181  if (chipindex >= 0) 
     
    191191(void) { 
    192192  const sensors_chip_name *chip; 
    193   int index = 0; 
    194   int ret = 0; 
    195  
    196   fprintf (sensorsLog, "%s: Sense.\n", now ()); 
     193  int index0 = 0; 
     194  int ret = 0; 
     195 
     196  fprintf (sensorsLog, "%s: Sense.\n", nowf()); 
    197197  fflush (sensorsLog); 
    198198 
    199   while (!done && (ret == 0) && ((chip = sensors_get_detected_chips (&index)) != NULL)) { 
     199  while (!done && (ret == 0) && ((chip = sensors_get_detected_chips (&index0)) != NULL)) { 
    200200    ret = readChip (chip); 
    201201  } 
    202202 
    203   fprintf (sensorsLog, "%s: Done.\n", now ()); 
     203  fprintf (sensorsLog, "%s: Done.\n", nowf()); 
    204204  fflush (sensorsLog); 
    205205 
     
    213213 
    214214  if (sensorsLog != NULL) { 
    215     fprintf (sensorsLog, "%s: Rotate.\n", now ()); 
     215    fprintf (sensorsLog, "%s: Rotate.\n", nowf()); 
    216216    fclose (sensorsLog); 
    217217  } 
     
    220220    ret = 1; 
    221221  } else { 
    222     fprintf (sensorsLog, "%s: Started.\n", now ()); 
     222    fprintf (sensorsLog, "%s: Started.\n", nowf()); 
    223223    fflush (sensorsLog); 
    224224  } 
     
    241241      strcpy (cfgPath, sensorsCfgFile); 
    242242    } else { 
    243       int index; 
    244       for (index = 0; sensorsCfgPaths[index]; ++ index) { 
    245         sprintf (cfgPath, "%s/%s", sensorsCfgPaths[index], sensorsCfgFile); 
     243      int index0; 
     244      for (index0 = 0; sensorsCfgPaths[index0]; ++ index0) { 
     245        sprintf (cfgPath, "%s/%s", sensorsCfgPaths[index0], sensorsCfgFile); 
    246246        if (stat (cfgPath, &stats) == 0) 
    247247          break; 
    248248      } 
    249       if (!sensorsCfgPaths[index]) { 
     249      if (!sensorsCfgPaths[index0]) { 
    250250        syslog (LOG_ERR, "Error locating sensors configuration: %s", sensorsCfgFile); 
    251251        return 9; 
     
    299299 
    300300  if (sensorsLog) { 
    301     fprintf (sensorsLog, "%s: %s.\n", now (), ret ? "Failed" : "Stopped"); 
     301    fprintf (sensorsLog, "%s: %s.\n", nowf(), ret ? "Failed" : "Stopped"); 
    302302    fclose (sensorsLog); 
    303303  }