mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
e42902a619
Avoid passing the ExpBlockModeProc function pointer through an object pointer type and instead move it to the proper place in the struct. Setting the channel version of expChannelType to 2 in the version field tells tcl's Tcl_ChannelBlockModeProc() to use the function pointer directly, and avoids undefined behavior. Using TCL_CHANNEL_VERSION_2 is the conservative choice, although version 5 would also work. discussed with stu tested/ok jca
33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
Get rid of implicit declaration of function warning
|
|
|
|
error: incompatible pointer types initializing 'Tcl_ChannelTypeVersion' (aka 'struct Tcl_ChannelTypeVersion_ *') with an expression of type 'int (ClientData, int)' (aka 'int (void *, int)') [-Wincompatible-pointer-types]
|
|
|
|
Index: exp_chan.c
|
|
--- exp_chan.c.orig
|
|
+++ exp_chan.c
|
|
@@ -37,6 +37,7 @@
|
|
#include "exp_log.h"
|
|
#include "tcldbg.h" /* Dbg_StdinMode */
|
|
|
|
+extern void exp_background_channelhandler(ClientData,int);
|
|
extern int expSetBlockModeProc _ANSI_ARGS_((int fd, int mode));
|
|
static int ExpBlockModeProc _ANSI_ARGS_((ClientData instanceData,
|
|
int mode));
|
|
@@ -58,7 +59,7 @@ static int ExpGetHandleProc _ANSI_ARGS_((ClientData i
|
|
|
|
Tcl_ChannelType expChannelType = {
|
|
"exp", /* Type name. */
|
|
- ExpBlockModeProc, /* Set blocking/nonblocking mode.*/
|
|
+ TCL_CHANNEL_VERSION_2, /* Version. */
|
|
ExpCloseProc, /* Close proc. */
|
|
ExpInputProc, /* Input proc. */
|
|
ExpOutputProc, /* Output proc. */
|
|
@@ -68,6 +69,7 @@ Tcl_ChannelType expChannelType = {
|
|
ExpWatchProc, /* Initialize notifier. */
|
|
ExpGetHandleProc, /* Get OS handles out of channel. */
|
|
NULL, /* Close2 proc */
|
|
+ ExpBlockModeProc, /* Set blocking/nonblocking mode.*/
|
|
};
|
|
|
|
typedef struct ThreadSpecificData {
|