docs/example patches for VMS

This commit is contained in:
Yang Tse
2009-06-05 18:40:40 +00:00
parent e3d65389d7
commit 6582895b51
4 changed files with 11 additions and 7 deletions

View File

@@ -13,7 +13,9 @@
#ifdef WIN32 #ifdef WIN32
# include <io.h> # include <io.h>
#else #else
# ifndef __VMS
# include <stdint.h> # include <stdint.h>
# endif
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>

View File

@@ -29,11 +29,12 @@ void dump(const char *text,
/* without the hex output, we can fit more on screen */ /* without the hex output, we can fit more on screen */
width = 0x40; width = 0x40;
fprintf(stream, "%s, %zd bytes (0x%zx)\n", text, size, size); fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
text, (long)size, (long)size);
for(i=0; i<size; i+= width) { for(i=0; i<size; i+= width) {
fprintf(stream, "%04zx: ", i); fprintf(stream, "%04.4lx: ", (long)i);
if(!nohex) { if(!nohex) {
/* hex not disabled, show it */ /* hex not disabled, show it */

View File

@@ -65,7 +65,7 @@ int main(int argc, char **argv)
printf("Couldnt open '%s': %s\n", LOCAL_FILE, strerror(errno)); printf("Couldnt open '%s': %s\n", LOCAL_FILE, strerror(errno));
return 1; return 1;
} }
printf("Local file size: %ld bytes.\n", file_info.st_size); printf("Local file size: %ld bytes.\n", (long)file_info.st_size);
/* get a FILE * of the same file */ /* get a FILE * of the same file */
hd_src = fopen(LOCAL_FILE, "rb"); hd_src = fopen(LOCAL_FILE, "rb");

View File

@@ -38,11 +38,12 @@ void dump(const char *text,
/* without the hex output, we can fit more on screen */ /* without the hex output, we can fit more on screen */
width = 0x40; width = 0x40;
fprintf(stream, "%s, %zd bytes (0x%zx)\n", text, size, size); fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
text, (long)size, (long)size);
for(i=0; i<size; i+= width) { for(i=0; i<size; i+= width) {
fprintf(stream, "%04zx: ", i); fprintf(stream, "%04.4lx: ", (long)i);
if(!nohex) { if(!nohex) {
/* hex not disabled, show it */ /* hex not disabled, show it */
@@ -74,7 +75,7 @@ void dump(const char *text,
static static
int my_trace(CURL *handle, curl_infotype type, int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size, unsigned char *data, size_t size,
void *userp) void *userp)
{ {
const char *text; const char *text;