/[pspp]/pspp/src/sfm-read.c
ViewVC logotype

Diff of /pspp/src/sfm-read.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by blp, Sun Aug 7 04:39:28 2005 UTC revision 1.26 by blp, Tue Oct 25 04:28:17 2005 UTC
# Line 89  struct sfm_var Line 89  struct sfm_var
89    
90  /* Swap bytes *A and *B. */  /* Swap bytes *A and *B. */
91  static inline void  static inline void
92  bswap (unsigned char *a, unsigned char *b)  bswap (char *a, char *b)
93  {  {
94    unsigned char t = *a;    char t = *a;
95    *a = *b;    *a = *b;
96    *b = t;    *b = t;
97  }  }
# Line 100  bswap (unsigned char *a, unsigned char * Line 100  bswap (unsigned char *a, unsigned char *
100  static inline void  static inline void
101  bswap_int32 (int32 *x_)  bswap_int32 (int32 *x_)
102  {  {
103    unsigned char *x = (unsigned char *) x_;    char *x = (char *) x_;
104    bswap (x + 0, x + 3);    bswap (x + 0, x + 3);
105    bswap (x + 1, x + 2);    bswap (x + 1, x + 2);
106  }  }
# Line 109  bswap_int32 (int32 *x_) Line 109  bswap_int32 (int32 *x_)
109  static inline void  static inline void
110  bswap_flt64 (flt64 *x_)  bswap_flt64 (flt64 *x_)
111  {  {
112    unsigned char *x = (unsigned char *) x_;    char *x = (char *) x_;
113    bswap (x + 0, x + 7);    bswap (x + 0, x + 7);
114    bswap (x + 1, x + 6);    bswap (x + 1, x + 6);
115    bswap (x + 2, x + 5);    bswap (x + 2, x + 5);
# Line 945  read_variables (struct sfm_reader *r, Line 945  read_variables (struct sfm_reader *r,
945                  if (vv->type == NUMERIC)                  if (vv->type == NUMERIC)
946                    mv_add_num (&vv->miss, mv[j]);                    mv_add_num (&vv->miss, mv[j]);
947                  else                  else
948                    mv_add_str (&vv->miss, (unsigned char *) &mv[j]);                    mv_add_str (&vv->miss, (char *) &mv[j]);
949              }              }
950            else            else
951              {              {
# Line 1036  read_value_labels (struct sfm_reader *r, Line 1036  read_value_labels (struct sfm_reader *r,
1036  {  {
1037    struct label    struct label
1038      {      {
1039        unsigned char raw_value[8]; /* Value as uninterpreted bytes. */        char raw_value[8];        /* Value as uninterpreted bytes. */
1040        union value value;        /* Value. */        union value value;        /* Value. */
1041        char *label;              /* Null-terminated label string. */        char *label;              /* Null-terminated label string. */
1042      };      };
# Line 1166  read_value_labels (struct sfm_reader *r, Line 1166  read_value_labels (struct sfm_reader *r,
1166                
1167        if (var[0]->type == ALPHA)        if (var[0]->type == ALPHA)
1168          {          {
1169            const int copy_len = min (sizeof (label->raw_value),            const int copy_len = min (sizeof label->raw_value,
1170                                      sizeof (label->label));                                      sizeof label->label);
1171            memcpy (label->value.s, label->raw_value, copy_len);            memcpy (label->value.s, label->raw_value, copy_len);
1172          } else {          } else {
1173            flt64 f;            flt64 f;

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26