PATCH: remove some warnings in src/lib

6 views
Skip to first unread message

Grégory Vanuxem

unread,
Jan 3, 2024, 6:45:10 PM1/3/24
to fricas...@googlegroups.com
Hello,

Two little modifications.
'val' is declared but not used in sockio-c.c.
In pixmap.c 'status' is declared, defined, but not used. I followed
the code from 'read_pixmap_file' but if the 'exit(1)' is not necessary
it can be removed.

=====================
diff '--color=auto' -Naur fricas_old/src/lib/pixmap.c fricas/src/lib/pixmap.c
--- fricas_old/src/lib/pixmap.c 2024-01-03 20:33:40.943900908 +0100
+++ fricas/src/lib/pixmap.c 2024-01-03 20:20:44.984723419 +0100
@@ -148,5 +148,8 @@
xi = XGetImage(dsp, wid, x, y, width, height, AllPlanes, ZPixmap);
if (xi==0) return ;
status=XpmWriteFileFromImage(dsp,fn,xi,0,0);
-
+ if (status != XpmSuccess) {
+ fprintf(stderr, "write_pixmap_file: unable to write %s\n", filename);
+ exit (1);
+ }
}
diff '--color=auto' -Naur fricas_old/src/lib/sockio-c.c
fricas/src/lib/sockio-c.c
--- fricas_old/src/lib/sockio-c.c 2024-01-03 20:33:40.943900908 +0100
+++ fricas/src/lib/sockio-c.c 2024-01-03 20:02:09.357188635 +0100
@@ -605,7 +605,6 @@
double
get_float(Sock *sock)
{
- int val;
double num = -1.0;
val = fill_buf(sock, (char *)&num, sizeof(double), "double");
#ifdef DEBUG
=====================

diff in attachment.

- Greg
fricas.diff

Waldek Hebisch

unread,
Jan 3, 2024, 9:10:08 PM1/3/24
to fricas...@googlegroups.com
On Thu, Jan 04, 2024 at 12:44:30AM +0100, Grégory Vanuxem wrote:
> Hello,
>
> Two little modifications.
> 'val' is declared but not used in sockio-c.c.
> In pixmap.c 'status' is declared, defined, but not used. I followed
> the code from 'read_pixmap_file' but if the 'exit(1)' is not necessary
> it can be removed.

I do not think we want 'exit' there: imagine a user trying to write
a graph to a directory where he/she has no write access. Killing
viewer instance in such case is not nice.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages