home: hub: 9ficl

Download patch

ref: 8add71c3c44fc1019077e7bc8a94f44f7933c8dc
parent: 8542bc8a6ae40a7f42c9ad63a12e2f6d01d45f48
author: asau <asau@ficl.sf.net>
date: Wed Dec 22 03:34:06 CST 2010

Use "char" for uncompressed text and "unsigned char" for compressed one.

--- a/ficl.h
+++ b/ficl.h
@@ -4,7 +4,7 @@
 ** Author: John Sadler (john_sadler@alum.mit.edu)
 ** Created: 19 July 1997
 ** Dedicated to RHS, in loving memory
-** $Id: ficl.h,v 1.29 2010/12/04 21:38:47 asau Exp $
+** $Id: ficl.h,v 1.30 2010/12/22 09:33:46 asau Exp $
 ********************************************************************
 **
 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
@@ -1846,7 +1846,7 @@
 
 #define FICL_MIN(a, b)  (((a) < (b)) ? (a) : (b))
 FICL_PLATFORM_EXTERN int ficlLzCompress(const char *uncompressed, size_t uncompressedSize, unsigned char **compressed, size_t *compressedSize);
-FICL_PLATFORM_EXTERN int ficlLzUncompress(const unsigned char *compressed, unsigned char **uncompressed, size_t *uncompressedSize);
+FICL_PLATFORM_EXTERN int ficlLzUncompress(const unsigned char *compressed, char **uncompressed, size_t *uncompressedSize);
 
 
 
--- a/lzuncompress.c
+++ b/lzuncompress.c
@@ -28,7 +28,7 @@
 
 
 
-int ficlLzUncompress(const unsigned char *compressed, unsigned char **uncompressed_p, size_t *uncompressedSize_p)
+int ficlLzUncompress(const unsigned char *compressed, char **uncompressed_p, size_t *uncompressedSize_p)
 	{
 	unsigned char *window;
 	unsigned char *buffer;
@@ -87,7 +87,7 @@
 			window = buffer - FICL_LZ_WINDOW_SIZE;
 		}
 
-	*uncompressed_p = uncompressed;
+	*uncompressed_p = (char *)uncompressed;
 	*uncompressedSize_p = uncompressedSize;
 
 	return 0;
--- a/softcore/makesoftcore.c
+++ b/softcore/makesoftcore.c
@@ -219,7 +219,7 @@
 "#if FICL_WANT_LZ_SOFTCORE\n"
 "    char *ficlSoftcoreUncompressed = NULL;\n"
 "    size_t gotUncompressedSize = 0;\n"
-"    returnValue = ficlLzUncompress(ficlSoftcoreCompressed, (unsigned char**)&ficlSoftcoreUncompressed, &gotUncompressedSize);\n"
+"    returnValue = ficlLzUncompress(ficlSoftcoreCompressed, &ficlSoftcoreUncompressed, &gotUncompressedSize);\n"
 "    FICL_VM_ASSERT(vm, returnValue == 0);\n"
 "    FICL_VM_ASSERT(vm, gotUncompressedSize == ficlSoftcoreUncompressedSize);\n"
 "#endif /* FICL_WANT_LZ_SOFTCORE */\n"