Permalink
Browse files

Apply 64 bit fix from Mentor Graphics

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
  • Loading branch information...
1 parent 65b238c commit e275397db25f0b8232ca2839a60d7c2ca8399b84 @kergoth committed Dec 28, 2011
Showing with 9 additions and 5 deletions.
  1. +4 −2 boot_format.c
  2. +5 −3 boot_format.h
View
@@ -690,8 +690,10 @@ int main(int argc, char *argv[])
if ((work_mode == BOOT_WORK_MODE_SPI)&& (rev_space != 0)) {
/* Extend file size to accomodate reserved space */
- lseek(h_dev, rev_space - 1, SEEK_CUR);
- write(h_dev, &n, 1);
+ if (rev_space) {
+ lseek(h_dev, rev_space - 1, SEEK_CUR);
+ write(h_dev, &n, 1);
+ }
}
lseek(h_dev, 0, SEEK_SET);
View
@@ -98,9 +98,11 @@
#define LITTLE_ENDIAN_MODE 0
#define BIG_ENDIAN_MODE 1
-#define uchar unsigned char
-#define ushort unsigned short
-#define uint unsigned int
+#include <stdint.h>
+
+#define uchar uint8_t
+#define ushort uint16_t
+#define uint uint32_t
#define MSG_OPEN_FILE_FAIL "Fail to open file \"%s\". Pls check whether it " \
"exists and verify your permission.\n"

0 comments on commit e275397

Please sign in to comment.