]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
fix compile errors in newer environment graphwork
authormarshmellow42 <marshmellowrf@gmail.com>
Thu, 13 Apr 2017 21:14:40 +0000 (17:14 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Thu, 13 Apr 2017 21:14:40 +0000 (17:14 -0400)
armsrc/crapto1.c
armsrc/crypto1.c
client/Makefile
client/proxgui.h
client/ui.c
client/ui/ui_overlays.h

index 9d491d1271ff1fdcda05b5ae980e1530f8d00ccc..74b4eea7026bade530fd3f0cf2c06ad000a7ce45 100644 (file)
@@ -34,22 +34,29 @@ static void __attribute__((constructor)) fill_lut()
 static void quicksort(uint32_t* const start, uint32_t* const stop)\r
 {\r
        uint32_t *it = start + 1, *rit = stop;\r
-\r
+       uint32_t tmp;\r
        if(it > rit)\r
                return;\r
 \r
-       while(it < rit)\r
-               if(*it <= *start)\r
+       while(it < rit) {\r
+               if(*it <= *start) {\r
                        ++it;\r
-               else if(*rit > *start)\r
+               } else if(*rit > *start) {\r
                        --rit;\r
-               else\r
-                       *it ^= (*it ^= *rit, *rit ^= *it);\r
+               } else {\r
+                       tmp = *it;\r
+                       *it = *rit;\r
+                       *rit = tmp;\r
+               }\r
+       }\r
 \r
        if(*rit >= *start)\r
                --rit;\r
-       if(rit != start)\r
-               *rit ^= (*rit ^= *start, *start ^= *rit);\r
+       if(rit != start) {\r
+               tmp = *rit;\r
+               *rit = *start;\r
+               *start = tmp;\r
+       }\r
 \r
        quicksort(start, rit - 1);\r
        quicksort(rit + 1, stop);\r
@@ -319,9 +326,11 @@ uint8_t lfsr_rollback_bit(struct Crypto1State *s, uint32_t in, int fb)
 {\r
        int out;\r
        uint8_t ret;\r
-\r
+       uint32_t tmp;\r
        s->odd &= 0xffffff;\r
-       s->odd ^= (s->odd ^= s->even, s->even ^= s->odd);\r
+       tmp = s->odd;\r
+       s->odd = s->even;\r
+       s->even = tmp;\r
 \r
        out = s->even & 1;\r
        out ^= LF_POLY_EVEN & (s->even >>= 1);\r
index 9d103c7f553ab285fd2410f8ad3a53e8d1e4fb39..3d56fab400947a3ceafcacfc327753e2f7668a52 100644 (file)
@@ -52,6 +52,7 @@ uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted)
 {
        uint32_t feedin;
        uint8_t ret = filter(s->odd);
+       uint32_t tmp;
 
        feedin  = ret & !!is_encrypted;
        feedin ^= !!in;
@@ -59,7 +60,9 @@ uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted)
        feedin ^= LF_POLY_EVEN & s->even;
        s->even = s->even << 1 | parity(feedin);
 
-       s->odd ^= (s->odd ^= s->even, s->even ^= s->odd);
+       tmp = s->odd;
+       s->odd = s->even;
+       s->even = tmp;
 
        return ret;
 }
index 621b5779b2237f9d3169b343c4dc8b479e9062b8..4d28216b186c713f77a320357974e8281e54850d 100644 (file)
@@ -16,25 +16,34 @@ LDLIBS = -L/opt/local/lib -L/usr/local/lib ../liblua/liblua.a -lreadline -lpthre
 LDFLAGS = $(COMMON_FLAGS)
 CFLAGS = -std=c99 -I. -I../include -I../common -I/opt/local/include -I../liblua -Wall $(COMMON_FLAGS) -g -O4
 LUAPLATFORM = generic
+
+platform = $(shell uname)
 ifneq (,$(findstring MINGW,$(platform)))
-CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
-QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
-MOC = $(QTDIR)/bin/moc
-LUAPLATFORM = mingw
-else ifeq ($(platform),Darwin)
-CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
-QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
-MOC = $(shell pkg-config --variable=moc_location QtCore)
-LUAPLATFORM = macosx
+    CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
+    ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
+        CXXFLAGS += -I$(QTDIR)/include/QtWidgets
+        QTLDLIBS = -L$(QTDIR)/lib -lQt5Core -lQt5Gui -lQt5Widgets
+    else
+        QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
+    endif
+    MOC = $(QTDIR)/bin/moc
+    LUAPLATFORM = mingw
 else
-CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
-QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
-MOC = $(shell pkg-config --variable=moc_location QtCore)
-LDLIBS +=  -ldl
-
-# Below is a variant you can use if you have problems compiling with QT5 on ubuntu. see http://www.proxmark.org/forum/viewtopic.php?id=1661 for more info. 
-#MOC = /usr/lib/x86_64-linux-gnu/qt4/bin/moc
-LUAPLATFORM = linux
+       CXXFLAGS = $(shell pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null) -Wall -O4
+       QTLDLIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
+       MOC = $(shell pkg-config --variable=host_bins Qt5Core)/moc
+       ifeq ($(QTLDLIBS), )
+               CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
+               QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+               MOC = $(shell pkg-config --variable=moc_location QtCore)
+       endif
+       ifeq ($(platform),Darwin)
+               LUAPLATFORM = macosx
+       else
+               LUALIB +=  -ldl
+               LDLIBS +=  -ltermcap -lncurses
+               LUAPLATFORM = linux
+       endif
 endif
 
 
index 0d50a4f6dcc279f2ea6f95b171d4d52545aa68d0..b8c4f6c45dc56fb063bed2e2afdbcb2e3388c454 100644 (file)
@@ -8,7 +8,7 @@
 // GUI functions
 //-----------------------------------------------------------------------------
 #include <string.h>
-
+#include <stdint.h>
 #ifdef __cplusplus
 extern "C" {
 #endif
index c0d01bc32983a2efb313f99640d745ce3af8cde9..bdaaf60ca4847e5d049742d4c5caeea8173d7381 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "ui.h"
 
-double CursorScaleFactor;
+double CursorScaleFactor = 0;
 int PlotGridX, PlotGridY, PlotGridXdefault= 64, PlotGridYdefault= 64;
 int offline;
 int flushAfterWrite = 0;  //buzzy
index 6e652c125ebea518ce1be045628b1be76c4675ab..83aa3e6cea617037574d0d00fa3ceedb42d383bf 100644 (file)
 #define OVERLAYSTQ7020_H
 
 #include <QtCore/QVariant>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QFormLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QHeaderView>
-#include <QtGui/QLabel>
-#include <QtGui/QPushButton>
-#include <QtGui/QSlider>
-#include <QtGui/QSpacerItem>
-#include <QtGui/QTabWidget>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QWidget>
+#include <QAction>
+#include <QApplication>
+#include <QButtonGroup>
+#include <QFormLayout>
+#include <QHBoxLayout>
+#include <QHeaderView>
+#include <QLabel>
+#include <QPushButton>
+#include <QSlider>
+#include <QSpacerItem>
+#include <QTabWidget>
+#include <QVBoxLayout>
+#include <QWidget>
 
 QT_BEGIN_NAMESPACE
 
@@ -198,19 +198,19 @@ public:
 
     void retranslateUi(QWidget *Form)
     {
-        Form->setWindowTitle(QApplication::translate("Form", "Overlays", 0, QApplication::UnicodeUTF8));
-        label->setText(QApplication::translate("Form", "Window size", 0, QApplication::UnicodeUTF8));
+        Form->setWindowTitle(QApplication::translate("Form", "Overlays", 0));
+        label->setText(QApplication::translate("Form", "Window size", 0));
         label_5->setText(QString());
-        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab), QApplication::translate("Form", "Autocorrelate", 0, QApplication::UnicodeUTF8));
-        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_3), QApplication::translate("Form", "Askdemod", 0, QApplication::UnicodeUTF8));
-        label_2->setText(QApplication::translate("Form", "Up", 0, QApplication::UnicodeUTF8));
+        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab), QApplication::translate("Form", "Autocorrelate", 0));
+        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_3), QApplication::translate("Form", "Askdemod", 0));
+        label_2->setText(QApplication::translate("Form", "Up", 0));
         label_6->setText(QString());
-        label_3->setText(QApplication::translate("Form", "Down", 0, QApplication::UnicodeUTF8));
+        label_3->setText(QApplication::translate("Form", "Down", 0));
         label_7->setText(QString());
-        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_2), QApplication::translate("Form", "Dirthreshold", 0, QApplication::UnicodeUTF8));
-        pushButton_apply->setText(QApplication::translate("Form", "Apply", 0, QApplication::UnicodeUTF8));
-        pushButton_sticky->setText(QApplication::translate("Form", "Sticky", 0, QApplication::UnicodeUTF8));
-        label_4->setText(QApplication::translate("Form", "TextLabel", 0, QApplication::UnicodeUTF8));
+        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_2), QApplication::translate("Form", "Dirthreshold", 0));
+        pushButton_apply->setText(QApplication::translate("Form", "Apply", 0));
+        pushButton_sticky->setText(QApplication::translate("Form", "Sticky", 0));
+        label_4->setText(QApplication::translate("Form", "TextLabel", 0));
     } // retranslateUi
 
 };
Impressum, Datenschutz