Browse Source

crcsync: fix constness warning.

/home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:Compile gave warnings:
/home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:30:3: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
/home/rusty/devel/cvs/ccan/ccan/crcsync/test/run-crash.c:35:3: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 13 years ago
parent
commit
b94efb3322
1 changed files with 3 additions and 3 deletions
  1. 3 3
      ccan/crcsync/test/run-crash.c

+ 3 - 3
ccan/crcsync/test/run-crash.c

@@ -14,7 +14,7 @@ typedef struct {
 	uint64_t *crcs;
 	uint64_t *crcs;
 } crc_info_t;
 } crc_info_t;
 
 
-static void crcblocks(crc_info_t *crc_info, char *data, int datalen, int blocksize)
+static void crcblocks(crc_info_t *crc_info, const char *data, int datalen, int blocksize)
 {
 {
 	crc_info->block_count = (datalen+blocksize-1)/blocksize;
 	crc_info->block_count = (datalen+blocksize-1)/blocksize;
 	crc_info->crcs = malloc(sizeof(uint64_t)*(crc_info->block_count + 1));
 	crc_info->crcs = malloc(sizeof(uint64_t)*(crc_info->block_count + 1));
@@ -26,11 +26,11 @@ static void crcblocks(crc_info_t *crc_info, char *data, int datalen, int blocksi
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
 	/* Divided into BLOCKSIZE blocks */
 	/* Divided into BLOCKSIZE blocks */
-	char *data1 =
+	const char *data1 =
 		"abcde" "fghij" "klmno" "pqrst" "uvwxy" "z ABC"
 		"abcde" "fghij" "klmno" "pqrst" "uvwxy" "z ABC"
 		"DEFGH" "IJKLM" "NOPQR" "STUVW" "XYZ 0" "12345" "6789";
 		"DEFGH" "IJKLM" "NOPQR" "STUVW" "XYZ 0" "12345" "6789";
 	/* Divided into blocks that match. */
 	/* Divided into blocks that match. */
-	char *data2 =
+	const char *data2 =
 		/* NO MATCH */
 		/* NO MATCH */
 		"acde"
 		"acde"
 		/* MATCH */
 		/* MATCH */