/* ztest.c -- Test for libbacktrace inflate code.
- Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ Copyright (C) 2017-2020 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
Redistribution and use in source and binary forms, with or without
/* Error callback. */
static void
-error_callback_compress (void *vdata, const char *msg, int errnum)
+error_callback_compress (void *vdata ATTRIBUTE_UNUSED, const char *msg,
+ int errnum)
{
fprintf (stderr, "%s", msg);
if (errnum > 0)
size_t ctimes[16];
size_t ztimes[16];
static const char * const names[] = {
- "Mark.Twain-Tom.Sawyer.txt",
- "../libgo/go/compress/testdata/Mark.Twain-Tom.Sawyer.txt"
+ "Isaac.Newton-Opticks.txt",
+ "../libgo/go/testdata/Isaac.Newton-Opticks.txt",
};
orig_buf = NULL;
fclose (e);
if (got > 0)
{
- orig_buf = rbuf;
+ orig_buf = (unsigned char *) rbuf;
orig_bufsize = got;
break;
}
}
compress_sizearg = compressed_bufsize - 12;
- r = compress (compressed_buf + 12, &compress_sizearg,
+ r = compress ((unsigned char *) compressed_buf + 12, &compress_sizearg,
orig_buf, orig_bufsize);
if (r != Z_OK)
{
}
uncompressed_bufsize = orig_bufsize;
- if (!backtrace_uncompress_zdebug (state, compressed_buf, compressed_bufsize,
+ if (!backtrace_uncompress_zdebug (state, (unsigned char *) compressed_buf,
+ compressed_bufsize,
error_callback_compress, NULL,
&uncompressed_buf, &uncompressed_bufsize))
{
return;
}
- if (!backtrace_uncompress_zdebug (state, compressed_buf,
+ if (!backtrace_uncompress_zdebug (state,
+ (unsigned char *) compressed_buf,
compressed_bufsize,
error_callback_compress, NULL,
&uncompressed_buf,
}
uncompress_sizearg = uncompressed_bufsize;
- r = uncompress (uncompressed_buf, &uncompress_sizearg,
- compressed_buf + 12, compressed_bufsize - 12);
+ r = uncompress ((unsigned char *) uncompressed_buf, &uncompress_sizearg,
+ (unsigned char *) compressed_buf + 12,
+ compressed_bufsize - 12);
if (clock_gettime (cid, &ts2) < 0)
{