IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2015, 9:44:51 PM (11 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20150419/Ohana/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150419/Ohana/src

  • branches/eam_branches/ipp-20150419/Ohana/src/libfits/header/F_modify.c

    r34577 r38447  
    4848    strncpy (comment, qe, p + 80 - qe);
    4949  }
    50   gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
     50  gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
    5151
    5252  /* write the numeric modes */
     
    134134    strncpy (comment, qe, p + 80 - qe);
    135135  }
    136   gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
     136  gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
    137137
    138138  /* write the boolean mode */
     
    166166    if (!ptr) goto invalid;
    167167    strncpy (comment, ptr, 80);
    168     gfits_pad_ending (comment, ' ', 82);  /* comment must contain spaces to the end */
     168    gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
    169169    snprintf (string, 81, "%-8s= %s / %-s", field, data, comment);
    170170    /* this will keep the original line, but truncate the comment */
     
    296296 */
    297297
     298// XXX this is an absurd patch on a gcc bug: memset has a problem is value != 0 and N is constant
     299void myMemset (char *ptr, int value, size_t N) {
     300
     301  char *p = ptr;
     302 
     303  size_t i = 0;
     304  for (i = 0; i < N; i++, p++) {
     305    *p = value;
     306  }
     307}
     308
    298309/* fill 'line' with Nbyte space from first NULL to last byte with value */
    299310void gfits_pad_ending (char *line, char value, int Nbyte) {
    300  
    301   char *p;
    302   int N;
    303311
    304312  line[Nbyte-1] = 0;
    305313 
    306   p = line + strlen (line);
    307   N = MAX (Nbyte - strlen (line) - 1, 0);
    308   memset (p, value, N);
     314  char *p = line + strlen (line);
     315  size_t N = MAX (Nbyte - strlen (line) - 1, 0);
     316  myMemset (p, value, N);
    309317}
    310318
Note: See TracChangeset for help on using the changeset viewer.