Ticket #38: patch64.txt

File patch64.txt, 6.1 KB (added by lzide.myopenid.com, 8 years ago)

Patch to compile leocad-0.75 on 64 bit computers

Line 
1Index: linux/dlgpiece.cpp
2===================================================================
3--- linux/dlgpiece.cpp  (revision 718)
4+++ linux/dlgpiece.cpp  (working copy)
5@@ -64,7 +64,7 @@
6 
7   info->wizard->ChangeColor (i, GPOINTER_TO_INT (data));
8   info->wizard->Redraw ();
9-  set_button_pixmap2 (button, FlatColorArray[(int)data]);
10+  set_button_pixmap2 (button, FlatColorArray[GPOINTER_TO_INT(data)]);
11 }
12 
13 // A color button was clicked
14Index: linux/dialogs.cpp
15===================================================================
16--- linux/dialogs.cpp   (revision 718)
17+++ linux/dialogs.cpp   (working copy)
18@@ -219,12 +219,12 @@
19 
20 void dlg_default_callback(GtkWidget *widget, gpointer data)
21 {
22-  *cur_ret = (int)data;
23+  *cur_ret = GPOINTER_TO_INT(data);
24 }
25 
26 gint dlg_delete_callback(GtkWidget *widget, GdkEvent* event, gpointer data)
27 {
28-  *cur_ret = def_ret;
29+  *cur_ret = GPOINTER_TO_INT(def_ret);
30   return TRUE;
31 }
32 
33Index: linux/main.cpp
34===================================================================
35--- linux/main.cpp      (revision 718)
36+++ linux/main.cpp      (working copy)
37@@ -128,7 +128,7 @@
38   if (ignore_commands)
39     return;
40 
41-  lcGetActiveProject()->HandleCommand((LC_COMMANDS)(int)data, 0);
42+  lcGetActiveProject()->HandleCommand((LC_COMMANDS)GPOINTER_TO_INT(data), 0);
43 }
44 
45 static void view_destroy (GtkWidget *widget, gpointer data)
46@@ -139,7 +139,7 @@
47 void OnCommand(GtkWidget* widget, gpointer data)
48 {
49   Project* project = lcGetActiveProject();
50-  int id = (int)data;
51+  int id = GPOINTER_TO_INT(data);
52 
53   if (ignore_commands)
54     return;
55Index: common/project.cpp
56===================================================================
57--- common/project.cpp  (revision 718)
58+++ common/project.cpp  (working copy)
59@@ -640,7 +640,7 @@
60 
61                for (pGroup = pLastGroup; pGroup; pGroup = pGroup->m_pNext)
62                {
63-                       i = (int)pGroup->m_pGroup;
64+                       i = GPOINTER_TO_INT(pGroup->m_pGroup);
65                        pGroup->m_pGroup = NULL;
66 
67                        if (i > 0xFFFF || i == -1)
68@@ -662,7 +662,7 @@
69                Piece* pPiece;
70                for (pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext)
71                {
72-                       i = (int)pPiece->GetGroup();
73+                       i = GPOINTER_TO_INT(pPiece->GetGroup());
74                        pPiece->SetGroup(NULL);
75 
76                        if (i > 0xFFFF || i == -1)
77@@ -4767,7 +4767,7 @@
78                                AddPiece(pPiece);
79                                pPiece->Select(true, false, false);
80 
81-                               j = (int)pPiece->GetGroup();
82+                               j = GPOINTER_TO_INT(pPiece->GetGroup());
83                                if (j != -1)
84                                        pPiece->SetGroup(groups[j]);
85                                else
86@@ -4776,7 +4776,7 @@
87 
88                        for (j = 0; j < i; j++)
89                        {
90-                               int g = (int)groups[j]->m_pGroup;
91+                               int g = GPOINTER_TO_INT(groups[j]->m_pGroup);
92                                groups[j]->m_pGroup = (g != -1) ? groups[g] : NULL;
93                        }
94 
95Index: config.mk
96===================================================================
97--- config.mk   (revision 718)
98+++ config.mk   (working copy)
99@@ -162,7 +162,7 @@
100        @echo -n "checking size of char... "; \
101        echo "#include <stdio.h>" > conftest.c; \
102        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
103-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(char)); exit(0); }" >> conftest.c; \
104+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(char)); exit(0); }" >> conftest.c; \
105        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
106          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
107          ac_cv_sizeof_char=`cat conftestval`; \
108@@ -172,12 +172,12 @@
109          ac_cv_sizeof_char=0; \
110        fi; \
111        echo "#define LC_SIZEOF_CHAR $$ac_cv_sizeof_char" >> $(OSDIR)/config.h; \
112-       rm -f conftest.c conftest conftestval; \
113+       cp conftest.c c.c && rm -f conftest.c conftest conftestval; \
114        \
115        echo -n "checking size of short... "; \
116        echo "#include <stdio.h>" > conftest.c; \
117        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
118-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(short)); exit(0); }" >> conftest.c; \
119+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(short)); exit(0); }" >> conftest.c; \
120        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
121          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
122          ac_cv_sizeof_short=`cat conftestval`; \
123@@ -192,7 +192,7 @@
124        echo -n "checking size of long... "; \
125        echo "#include <stdio.h>" > conftest.c; \
126        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
127-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(long)); exit(0); }" >> conftest.c; \
128+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(long)); exit(0); }" >> conftest.c; \
129        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
130          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
131          ac_cv_sizeof_long=`cat conftestval`; \
132@@ -207,7 +207,7 @@
133        echo -n "checking size of int... "; \
134        echo "#include <stdio.h>" > conftest.c; \
135        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
136-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(int)); exit(0); }" >> conftest.c; \
137+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(int)); exit(0); }" >> conftest.c; \
138        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
139          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
140          ac_cv_sizeof_int=`cat conftestval`; \
141@@ -222,7 +222,7 @@
142        echo -n "checking size of void *... "; \
143        echo "#include <stdio.h>" > conftest.c; \
144        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
145-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(void *)); exit(0); }" >> conftest.c; \
146+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(void *)); exit(0); }" >> conftest.c; \
147        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
148          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
149          ac_cv_sizeof_void_p=`cat conftestval`; \
150@@ -237,7 +237,7 @@
151        echo -n "checking size of long long... "; \
152        echo "#include <stdio.h>" > conftest.c; \
153        echo "main() { FILE *f=fopen(\"conftestval\", \"w\");" >> conftest.c; \
154-       echo "if (!f) exit(1); fprintf(f, \"%d\\n\", sizeof(long long)); exit(0); }" >> conftest.c; \
155+       echo "if (!f) exit(1); fprintf(f, \"%d\\\n\", sizeof(long long)); exit(0); }" >> conftest.c; \
156        if { (eval $(CC) conftest.c -o conftest) 2> /dev/null; } && \
157          (test -s conftest && (./conftest; exit) 2> /dev/null); then \
158          ac_cv_sizeof_long_long=`cat conftestval`; \