openbsd-ports/x11/xpostit/patches/patch-note_c
naddy b5ee94956f x11/xpostit: explicitly cast integer to pointer to fix build with clang 15
The callback takes a pointer to be able to pass arbitrary data, but
instead of allocating an int and passing a pointer to it, the code
jams the int directly into the pointer for an int -> pointer -> int
roundtrip.  Problem reported by and discussed with jca@.

Fix implicit function declarations.
2023-01-29 00:07:55 +00:00

47 lines
1.1 KiB
Plaintext

Index: note.c
--- note.c.orig
+++ note.c
@@ -97,6 +97,7 @@ static char *RCSid = "$Header: /home/harbor/davy/stuff
#include <X11/Intrinsic.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
#include <X11/Xaw/Form.h>
#include <X11/Shell.h>
#include <sys/param.h>
@@ -105,7 +106,10 @@ static char *RCSid = "$Header: /home/harbor/davy/stuff
#else
#include <sys/dir.h>
#endif
+#include <sys/stat.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "xpostit.h"
#include "vroot.h"
@@ -135,6 +139,7 @@ static void CancelDestroy();
static void ConfirmDestroy();
static void MakeNoteWidget();
static void NoteProtocolsHandler();
+static void GetNotePosition();
static XtEventHandler StructureNotifyHandler();
@@ -238,7 +243,6 @@ LoadSavedNotes()
{
DIR *dp;
FILE *fp;
- char *realloc();
register PostItNote *pn;
#if defined(USG) || defined(SYSV) || defined(SVR4)
register struct dirent *d;
@@ -1169,6 +1173,7 @@ NoteIndex()
*
* Thanks to Stewart Levin for the original code.
*/
+static void
GetNotePosition(w, x, y)
int *x, *y;
Widget w;