Raymond Toy pushed to branch master at cmucl / cmucl
Commits: a3a3fbd9 by Raymond Toy at 2024-05-30T14:38:30+00:00 Fix #312: Use correct type for message_write_float
- - - - - 7e7f3f0f by Raymond Toy at 2024-05-30T14:38:41+00:00 Merge branch 'issue-312-motif-server' into 'master'
Fix #312: Use correct type for message_write_float
Closes #312
See merge request cmucl/cmucl!218 - - - - -
3 changed files:
- src/motif/server/datatrans.c - src/motif/server/datatrans.h - src/motif/server/tables.h
Changes:
===================================== src/motif/server/datatrans.c ===================================== @@ -265,10 +265,10 @@ void message_write_color(message_t m,XColor *color,int tag) message_put_word(m,color->blue); }
-void message_write_float(message_t m,float f,int tag) +void message_write_float(message_t m,void *f,int tag) { message_put_dblword(m,combine_type_and_data(tag,0)); - message_put_dblword(m,f); + message_put_dblword(m,*(long *) f); }
@@ -524,8 +524,8 @@ void message_read_color(message_t m,XColor *color,int tag, int red)
void message_read_float(message_t m,float *f,int tag,int data) { - fprintf(stderr,">>>>> Warning:message_read_float: Not implemented.\n"); - fflush(stderr); + long d = message_get_dblword(m); + memcpy(f, &d, sizeof(*f)); }
===================================== src/motif/server/datatrans.h ===================================== @@ -38,7 +38,7 @@ extern void message_write_int_list(); extern void message_write_event(); extern void message_write_color(); /* GCC complains without the full prototype */ -extern void message_write_float(message_t,float,int); +extern void message_write_float(message_t,void *,int);
===================================== src/motif/server/tables.h ===================================== @@ -10,8 +10,8 @@ #ifndef TABLES_H #define TABLES_H
-typedef void (*type_writer)(message_t out,caddr_t src,int type_tag); -typedef void (*type_reader)(message_t in,caddr_t dest,int type_tag,int data); +typedef void (*type_writer)(message_t out,void *src,int type_tag); +typedef void (*type_reader)(message_t in,void *dest,int type_tag,int data);
typedef struct { String type;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/f25af05f0db978d2f056fac...