projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge 'master' into 'psppsheet'.
[pspp]
/
src
/
libpspp
/
zip-writer.c
diff --git
a/src/libpspp/zip-writer.c
b/src/libpspp/zip-writer.c
index e93ec887e8be952e08a3db28cd79c4b139ec8249..d626d929b374776d8574318a995ba92de80dcce1 100644
(file)
--- a/
src/libpspp/zip-writer.c
+++ b/
src/libpspp/zip-writer.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010
, 2012
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-19,12
+19,11
@@
#include "libpspp/zip-writer.h"
#include "libpspp/zip-private.h"
#include "libpspp/zip-writer.h"
#include "libpspp/zip-private.h"
+#include <byteswap.h>
#include <errno.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <time.h>
-#include "libpspp/integer-format.h"
-
#include "gl/crc.h"
#include "gl/error.h"
#include "gl/fwriteerror.h"
#include "gl/crc.h"
#include "gl/error.h"
#include "gl/fwriteerror.h"
@@
-63,16
+62,18
@@
put_bytes (struct zip_writer *zw, const void *p, size_t n)
static void
put_u16 (struct zip_writer *zw, uint16_t x)
{
static void
put_u16 (struct zip_writer *zw, uint16_t x)
{
- if (INTEGER_NATIVE != INTEGER_LSB_FIRST)
- integer_convert (INTEGER_NATIVE, &x, INTEGER_MSB_FIRST, &x, sizeof x);
+#ifdef WORDS_BIGENDIAN
+ x = bswap_16 (x);
+#endif
put_bytes (zw, &x, sizeof x);
}
static void
put_u32 (struct zip_writer *zw, uint32_t x)
{
put_bytes (zw, &x, sizeof x);
}
static void
put_u32 (struct zip_writer *zw, uint32_t x)
{
- if (INTEGER_NATIVE != INTEGER_LSB_FIRST)
- integer_convert (INTEGER_NATIVE, &x, INTEGER_MSB_FIRST, &x, sizeof x);
+#ifdef WORDS_BIGENDIAN
+ x = bswap_32 (x);
+#endif
put_bytes (zw, &x, sizeof x);
}
put_bytes (zw, &x, sizeof x);
}