Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/x11/bbrun/files/patch-bbrun.c
21793 views
1
--- bbrun.c.orig 2004-02-13 01:24:59.000000000 +0100
2
+++ bbrun.c 2012-06-01 20:42:51.000000000 +0200
3
@@ -3,7 +3,11 @@
4
#include <string.h>
5
#include <getopt.h>
6
#include <unistd.h>
7
+#ifdef __FreeBSD__
8
+#include <sys/types.h>
9
+#else
10
#include <linux/types.h>
11
+#endif
12
#include <X11/xpm.h>
13
#include <gtk/gtk.h>
14
#include <gdk/gdkkeysyms.h>
15
@@ -20,7 +24,7 @@
16
#define ADVANCED_WINDOW_ROWS 3
17
#define ADVANCED_WINDOW_COLS 10
18
19
-#define u32 __u32
20
+#define u32 uintptr_t
21
#define __DEBUG__ 0
22
#define VERSION "1.6"
23
24
@@ -38,8 +42,8 @@ char historyFilename[MAXPATHLEN + 1];
25
26
// TOC = Table Of Contents, it is a dynamically allocated array of pointers to dynamically
27
// allocated history items.
28
-u32 *histTOC; // Always keep track of the beginning, this one is NEVER incremented.
29
-u32 *histTOC2; // We increment this one for each item
30
+u32 *histTOC = NULL; // Always keep track of the beginning, this one is NEVER incremented.
31
+u32 *histTOC2 = NULL; // We increment this one for each item
32
33
void parseArguments(int, char **);
34
void execDialogInformation();
35
@@ -197,7 +201,7 @@ void readHistory(void) {
36
37
item = malloc(strlen(buf));
38
strncpy(item, buf, strlen(buf));
39
- item[strlen(buf)- 1] = 0x0; // Remove the newline char
40
+ item[strlen(buf)- 1] = '\0'; // Remove the newline char
41
42
*histTOC2 = (u32) item;
43
} else {
44
@@ -322,7 +326,7 @@ void writeHistory()
45
// Event handler for Ok and Cancel buttons
46
void callback (GtkWidget * widget, gpointer data)
47
{
48
- if ((char *) data == "ok")
49
+ if ((strcmp(data, "ok")) == 0)
50
execDialogInformation();
51
52
gtk_main_quit();
53
54