IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26521


Ignore:
Timestamp:
Jan 5, 2010, 5:01:17 PM (16 years ago)
Author:
Paul Price
Message:

Fixing order of parameters following warning:
In function ‘memset’, inlined from ‘InitMachines’ at .../MachineOps.c:17:
/usr/include/bits/string3.h:82: error: call to ‘warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/MachineOps.c

    r26412 r26521  
    1515
    1616  ALLOCATE (machines, Machine *, NMACHINES);
    17   memset (machines, NMACHINES*sizeof(Machine *), 0);
     17  memset (machines, 0, NMACHINES*sizeof(Machine *));
    1818
    1919  return;
     
    3636
    3737  int i;
    38  
     38
    3939  for (i = 0; i < Nmachines; i++) {
    4040    if (!strcmp (machines[i][0].name, name)) {
     
    6565    NMACHINES += 10;
    6666    REALLOCATE (machines, Machine *, NMACHINES);
    67     memset (&machines[Nmachines], (NMACHINES - Nmachines)*sizeof(Machine *), 0);
     67    memset (&machines[Nmachines], 0, (NMACHINES - Nmachines)*sizeof(Machine *));
    6868  }
    6969
     
    113113  ASSERT (machine, "cannot find machine associated with host");
    114114  machine[0].NjobsRealhost ++;
    115  
     115
    116116  // skip jobs that do not have a targeted host
    117117  if (job[0].hostname == NULL) {
     
    128128  if (machine == NULL) return (TRUE);
    129129  machine[0].NjobsWanthost ++;
    130  
     130
    131131  return (TRUE);
    132132}
     
    155155  if (machine == NULL) return (TRUE);
    156156  machine[0].NjobsWanthost --;
    157  
     157
    158158  return (TRUE);
    159159}
     
    164164  Machine *machine;
    165165
    166   gprint (GP_LOG, "Nmachines: %d\n", Nmachines); 
     166  gprint (GP_LOG, "Nmachines: %d\n", Nmachines);
    167167  for (i = 0; i < Nmachines; i++) {
    168168    machine = machines[i];
    169     gprint (GP_LOG, "%s : %d : %d : %d\n", machine[0].name, machine[0].Nhosts, machine[0].NjobsRealhost, machine[0].NjobsWanthost); 
     169    gprint (GP_LOG, "%s : %d : %d : %d\n", machine[0].name, machine[0].Nhosts, machine[0].NjobsRealhost, machine[0].NjobsWanthost);
    170170  }
    171171
Note: See TracChangeset for help on using the changeset viewer.