]> Shamusworld >> Repos - ttedit/commitdiff
Fix to prevent segfaulting on 64-bit platforms.
authorShamus Hammons <jlhamm@acm.org>
Mon, 6 Feb 2012 17:27:17 +0000 (17:27 +0000)
committerShamus Hammons <jlhamm@acm.org>
Mon, 6 Feb 2012 17:27:17 +0000 (17:27 +0000)
Makefile
src/ttedit.cpp
src/ttedit.h

index d869379328dbc32f37eab0040821c1e9d3d2a6e6..77744df6faeb2a18bb3defa7a6a9dc5cc2625ab5 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ttedit
-# Generated by qmake (2.01a) (Qt 4.5.0) on: Tue Mar 24 12:51:09 2009
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Feb 6 15:32:02 2012
 # Project:  ttedit.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile ttedit.pro
 CC            = gcc
 CXX           = g++
 DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-CFLAGS        = -pipe -O2 -pipe -march=athlon -D_REENTRANT -Wall -W $(DEFINES)
-CXXFLAGS      = -pipe -O2 -pipe -march=athlon -D_REENTRANT -Wall -W $(DEFINES)
-INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Iobj -Iobj
+CFLAGS        = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES)
+CXXFLAGS      = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES)
+INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Iobj
 LINK          = g++
-LFLAGS        = -Wl,--as-needed
-LIBS          = $(SUBLIBS)  -L/usr/lib/qt4 -lQtGui -L/usr/lib/qt4 -L/usr/X11R6/lib -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lXrandr -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
+LFLAGS        = -Wl,-O1
+LIBS          = $(SUBLIBS)  -L/usr/lib64/qt4 -lQtGui -L/usr/lib64 -L/usr/lib64/qt4 -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread 
 AR            = ar cqs
 RANLIB        = 
 QMAKE         = /usr/bin/qmake
@@ -26,11 +26,12 @@ COPY          = cp -f
 SED           = sed
 COPY_FILE     = $(COPY)
 COPY_DIR      = $(COPY) -r
+STRIP         = strip
 INSTALL_FILE  = install -m 644 -p
 INSTALL_DIR   = $(COPY_DIR)
 INSTALL_PROGRAM = install -m 755 -p
 DEL_FILE      = rm -f
-SYMLINK       = ln -sf
+SYMLINK       = ln -f -s
 DEL_DIR       = rmdir
 MOVE          = mv -f
 CHK_DIR_EXISTS= test -d
@@ -69,10 +70,15 @@ OBJECTS       = obj/ttedit.o \
                obj/moc_toolwindow.o \
                obj/moc_charwindow.o \
                obj/qrc_ttedit.o
-DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
-               /usr/share/qt4/mkspecs/common/unix.conf \
+DIST          = /usr/share/qt4/mkspecs/common/unix.conf \
                /usr/share/qt4/mkspecs/common/linux.conf \
+               /usr/share/qt4/mkspecs/common/gcc-base.conf \
+               /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
+               /usr/share/qt4/mkspecs/common/g++-base.conf \
+               /usr/share/qt4/mkspecs/common/g++-unix.conf \
                /usr/share/qt4/mkspecs/qconfig.pri \
+               /usr/share/qt4/mkspecs/modules/qt_phonon.pri \
+               /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
                /usr/share/qt4/mkspecs/features/qt_functions.prf \
                /usr/share/qt4/mkspecs/features/qt_config.prf \
                /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -82,6 +88,7 @@ DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
                /usr/share/qt4/mkspecs/features/qt.prf \
                /usr/share/qt4/mkspecs/features/unix/thread.prf \
                /usr/share/qt4/mkspecs/features/moc.prf \
+               /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
                /usr/share/qt4/mkspecs/features/warn_on.prf \
                /usr/share/qt4/mkspecs/features/resources.prf \
                /usr/share/qt4/mkspecs/features/uic.prf \
@@ -119,10 +126,15 @@ all: Makefile $(TARGET)
 $(TARGET):  $(OBJECTS)  
        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 
-Makefile: ttedit.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
-               /usr/share/qt4/mkspecs/common/unix.conf \
+Makefile: ttedit.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
                /usr/share/qt4/mkspecs/common/linux.conf \
+               /usr/share/qt4/mkspecs/common/gcc-base.conf \
+               /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
+               /usr/share/qt4/mkspecs/common/g++-base.conf \
+               /usr/share/qt4/mkspecs/common/g++-unix.conf \
                /usr/share/qt4/mkspecs/qconfig.pri \
+               /usr/share/qt4/mkspecs/modules/qt_phonon.pri \
+               /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
                /usr/share/qt4/mkspecs/features/qt_functions.prf \
                /usr/share/qt4/mkspecs/features/qt_config.prf \
                /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
@@ -132,18 +144,24 @@ Makefile: ttedit.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4
                /usr/share/qt4/mkspecs/features/qt.prf \
                /usr/share/qt4/mkspecs/features/unix/thread.prf \
                /usr/share/qt4/mkspecs/features/moc.prf \
+               /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
                /usr/share/qt4/mkspecs/features/warn_on.prf \
                /usr/share/qt4/mkspecs/features/resources.prf \
                /usr/share/qt4/mkspecs/features/uic.prf \
                /usr/share/qt4/mkspecs/features/yacc.prf \
                /usr/share/qt4/mkspecs/features/lex.prf \
-               /usr/lib/qt4/libQtGui.prl \
-               /usr/lib/qt4/libQtCore.prl
+               /usr/lib64/qt4/libQtGui.prl \
+               /usr/lib64/qt4/libQtCore.prl
        $(QMAKE) -unix -o Makefile ttedit.pro
-/usr/share/qt4/mkspecs/common/g++.conf:
 /usr/share/qt4/mkspecs/common/unix.conf:
 /usr/share/qt4/mkspecs/common/linux.conf:
+/usr/share/qt4/mkspecs/common/gcc-base.conf:
+/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
+/usr/share/qt4/mkspecs/common/g++-base.conf:
+/usr/share/qt4/mkspecs/common/g++-unix.conf:
 /usr/share/qt4/mkspecs/qconfig.pri:
+/usr/share/qt4/mkspecs/modules/qt_phonon.pri:
+/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
 /usr/share/qt4/mkspecs/features/qt_functions.prf:
 /usr/share/qt4/mkspecs/features/qt_config.prf:
 /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
@@ -153,13 +171,14 @@ Makefile: ttedit.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4
 /usr/share/qt4/mkspecs/features/qt.prf:
 /usr/share/qt4/mkspecs/features/unix/thread.prf:
 /usr/share/qt4/mkspecs/features/moc.prf:
+/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
 /usr/share/qt4/mkspecs/features/warn_on.prf:
 /usr/share/qt4/mkspecs/features/resources.prf:
 /usr/share/qt4/mkspecs/features/uic.prf:
 /usr/share/qt4/mkspecs/features/yacc.prf:
 /usr/share/qt4/mkspecs/features/lex.prf:
-/usr/lib/qt4/libQtGui.prl:
-/usr/lib/qt4/libQtCore.prl:
+/usr/lib64/qt4/libQtGui.prl:
+/usr/lib64/qt4/libQtCore.prl:
 qmake:  FORCE
        @$(QMAKE) -unix -o Makefile ttedit.pro
 
@@ -180,6 +199,8 @@ distclean: clean
        -$(DEL_FILE) Makefile
 
 
+check: first
+
 mocclean: compiler_moc_header_clean compiler_moc_source_clean
 
 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
@@ -224,9 +245,9 @@ obj/qrc_ttedit.cpp: ttedit.qrc \
                res/cursor4.png
        /usr/bin/rcc -name ttedit ttedit.qrc -o obj/qrc_ttedit.cpp
 
-compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_make_all: obj/qmake_image_collection.cpp
 compiler_image_collection_clean:
-       -$(DEL_FILE) qmake_image_collection.cpp
+       -$(DEL_FILE) obj/qmake_image_collection.cpp
 compiler_moc_source_make_all:
 compiler_moc_source_clean:
 compiler_uic_make_all:
index 54617e944e4ec6d47f485cb2c05d741814bb44db..a657cad17a48bb10d259299b5ad786b1b68aadd3 100755 (executable)
@@ -44,6 +44,9 @@
 
 TTEdit::TTEdit(int argc, char * argv[]): QApplication(argc, argv), charWnd(NULL)
 {
+       mainWindow = new TTEMainWindow;
+//printf("mainWindow.show();\n");
+       mainWindow->show();
 }
 
 
@@ -56,9 +59,6 @@ int main(int argc, char * argv[])
 //printf("TTEdit app(argc, argv);\n");
        TTEdit app(argc, argv);
 //printf("TTEMainWindow mainWindow;\n");
-       TTEMainWindow mainWindow;
-//printf("mainWindow.show();\n");
-       mainWindow.show();
 //OK, it gets to here at least...
 //printf("return app.exec();\n");
        return app.exec();
index 3adf6e8ba509bf31dbd93b2020f1ef57fe8fe389..1aa2b0e20dbb904d9e221c9af32aac4bd1c21e30 100755 (executable)
@@ -13,6 +13,7 @@
 
 // Forward declarations
 class CharWindow;
+class TTEMainWindow;
 
 class TTEdit: public QApplication
 {
@@ -21,6 +22,7 @@ class TTEdit: public QApplication
 
        public:
                CharWindow * charWnd;
+               TTEMainWindow * mainWindow;
 };
 
 #endif // __TTEDIT_H__