summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile6
-rw-r--r--tools/envcrc.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 8784a6d..b897923 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -236,7 +236,11 @@ $(obj)environment.c:
$(obj)environment.o: $(obj)environment.c
$(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
-$(obj)crc32.c:
+$(obj)zlib.h:
+ @rm -f $@
+ ln -s $(src)../include/zlib.h $@
+
+$(obj)crc32.c: $(obj)zlib.h
@rm -f $(obj)crc32.c
ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 7b77183..550cf82 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -22,6 +22,7 @@
*/
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
@@ -58,15 +59,15 @@
#endif /* CFG_ENV_IS_IN_FLASH */
#ifdef CFG_REDUNDAND_ENVIRONMENT
-# define ENV_HEADER_SIZE (sizeof(unsigned long) + 1)
+# define ENV_HEADER_SIZE (sizeof(uint32_t) + 1)
#else
-# define ENV_HEADER_SIZE (sizeof(unsigned long))
+# define ENV_HEADER_SIZE (sizeof(uint32_t))
#endif
#define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE)
-extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
+extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
#ifdef ENV_IS_EMBEDDED
extern unsigned int env_size;
@@ -76,7 +77,7 @@ extern unsigned char environment;
int main (int argc, char **argv)
{
#ifdef ENV_IS_EMBEDDED
- int crc;
+ uint32_t crc;
unsigned char *envptr = &environment,
*dataptr = envptr + ENV_HEADER_SIZE;
unsigned int datasize = ENV_SIZE;