From 162d18d8d613eb6ad159f41dce01d581baad97a6 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 1 Jul 2021 07:48:39 -0700 Subject: [PATCH] remove unused gvfwrite The last use of gvfwrite was removed in 6e818420cf02ad01d9c976b69d49fb794a661f5e. But more problematically, this function seems incorrect. By ignoring its size argument it will generate surprising results if ever called with a non-1 size. Closes #1846. --- lib/gvc/gvc.def | 1 - lib/gvc/gvdevice.c | 7 ------- lib/gvc/gvio.h | 1 - 3 files changed, 9 deletions(-) diff --git a/lib/gvc/gvc.def b/lib/gvc/gvc.def index 1dcc8f641..0f98b9298 100644 --- a/lib/gvc/gvc.def +++ b/lib/gvc/gvc.def @@ -300,7 +300,6 @@ zmalloc zrealloc colorxlate gvContextPlugins -gvfwrite gvferror getPackInfo getPackModeInfo diff --git a/lib/gvc/gvdevice.c b/lib/gvc/gvdevice.c index 93efce342..591af6142 100644 --- a/lib/gvc/gvdevice.c +++ b/lib/gvc/gvdevice.c @@ -262,13 +262,6 @@ int gvferror (FILE* stream) return 0; } -size_t gvfwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size = sizeof(char); - assert(size); - return gvwrite((GVJ_t*)stream, ptr, nmemb); -} - int gvputs(GVJ_t * job, const char *s) { size_t len = strlen(s); diff --git a/lib/gvc/gvio.h b/lib/gvc/gvio.h index 299afed78..fc7d48013 100644 --- a/lib/gvc/gvio.h +++ b/lib/gvc/gvio.h @@ -33,7 +33,6 @@ extern "C" { /*end visual studio*/ extern size_t gvwrite (GVJ_t * job, const char *s, size_t len); - extern size_t gvfwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream); extern int gvferror (FILE *stream); extern int gvputc(GVJ_t * job, int c); extern int gvputs(GVJ_t * job, const char *s); -- 2.40.0