From 38fb522026b16fb83f49e2b2f32884ffaca177dd Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Mon, 6 Feb 2012 17:27:17 +0000 Subject: [PATCH] Fix to prevent segfaulting on 64-bit platforms. --- Makefile | 57 ++++++++++++++++++++++++++++++++++---------------- src/ttedit.cpp | 6 +++--- src/ttedit.h | 2 ++ 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index d869379..77744df 100755 --- 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 @@ -11,12 +11,12 @@ 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: diff --git a/src/ttedit.cpp b/src/ttedit.cpp index 54617e9..a657cad 100755 --- a/src/ttedit.cpp +++ b/src/ttedit.cpp @@ -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(); diff --git a/src/ttedit.h b/src/ttedit.h index 3adf6e8..1aa2b0e 100755 --- a/src/ttedit.h +++ b/src/ttedit.h @@ -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__ -- 2.37.2