summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/compiler.h10
-rw-r--r--pwmanager/pwmanager/pwm.h3
-rw-r--r--pwmanager/pwmanager/pwmanager.pro4
-rw-r--r--pwmanager/pwmanager/pwmdoc.h4
-rw-r--r--pwmanager/pwmanager/randomizer.cpp8
-rw-r--r--pwmanager/pwmanager/setmasterpwwndimpl.h4
-rw-r--r--pwmanager/pwmanager/sha1.h9
7 files changed, 32 insertions, 10 deletions
diff --git a/pwmanager/pwmanager/compiler.h b/pwmanager/pwmanager/compiler.h
index be08c6d..a942246 100644
--- a/pwmanager/pwmanager/compiler.h
+++ b/pwmanager/pwmanager/compiler.h
@@ -8,12 +8,20 @@
* *
***************************************************************************/
#ifndef __PWMANAGER_COMPILER_H
#define __PWMANAGER_COMPILER_H
+#ifdef _WIN32_
+# define __builtin_expect(x, expected_value) (x)
+#define NOREGPARM __attribute__((regparm(0)))
+#define REGPARM __attribute__((regparm(3)))
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
+#else
#ifdef __deprecated
# undef __deprecated
#endif
#if __GNUC__ >= 3
# if __GNUC_MINOR__ > 0
# define __deprecated __attribute__((deprecated))
@@ -54,8 +62,8 @@
#endif
#define NOREGPARM __attribute__((regparm(0)))
#ifdef REGPARM
# undef REGPARM
#endif
#define REGPARM __attribute__((regparm(3)))
-
+#endif
#endif // __PWMANAGER_COMPILER_H
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index 116bc66..6ab9d6b 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -138,14 +138,13 @@ public slots:
void addPwd_slot();
void addPwd_slot1(QString *pw, PwMDoc *_doc);
/** manage/edit triggered */
//US ENH : changed code to run with older MOC
void editPwd_slot();
void editPwd_slot1(const QString *category);
- void editPwd_slot3(const QString *category = 0, const int *index = 0,
- PwMDoc *_doc = 0);
+ void editPwd_slot3(const QString *category, const int *index ,PwMDoc *_doc );
/** manage/delete triggered */
void deletePwd_slot();
/** execute the "Launcher" entry */
void execLauncher_slot();
/** open browser with URL entry */
diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro
index 7f39c76..49c1f46 100644
--- a/pwmanager/pwmanager/pwmanager.pro
+++ b/pwmanager/pwmanager/pwmanager.pro
@@ -1,8 +1,8 @@
TEMPLATE = app
-CONFIG += qt warn_on
+CONFIG += qt warn_off
DESTDIR= ../../bin
TARGET = pwmpi
include( ../../variables.pri )
INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils
DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION
@@ -27,13 +27,13 @@ MOC_DIR = moc/unix
win32:{
DEFINES += _WIN32_
OBJECTS_DIR = obj/win
MOC_DIR = moc/win
QMAKE_LINK += /NODEFAULTLIB:LIBC
-
+QMAKE_CXXFLAGS += /TP /GX /GR /Ehsc
}
#INTERFACES = \
#addentrywnd.ui \
#configwnd.ui \
#findwnd.ui \
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index 635361a..55e3231 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -16,13 +16,15 @@
*
* $Id$
**************************************************************************/
#ifndef __PWMDOC_H
#define __PWMDOC_H
-
+#ifdef _WIN32_
+#define ssize_t unsigned int
+#endif
#define PWM_FILE_VER (static_cast<char>(0x05))
#define PWM_HASH_SHA1 (static_cast<char>(0x01))
#define PWM_HASH_SHA256 (static_cast<char>(0x02))
#define PWM_HASH_SHA384 (static_cast<char>(0x03))
#define PWM_HASH_SHA512 (static_cast<char>(0x04))
diff --git a/pwmanager/pwmanager/randomizer.cpp b/pwmanager/pwmanager/randomizer.cpp
index e1085ff..da4df78 100644
--- a/pwmanager/pwmanager/randomizer.cpp
+++ b/pwmanager/pwmanager/randomizer.cpp
@@ -32,14 +32,18 @@
#ifndef Q_LONG
#define Q_LONG long
#endif
#endif //PWM_EMBEDDED
-
-
+#ifdef _WIN32_
+int rand_r( uint * seed ) {
+ srand(*seed);
+ return rand();
+}
+#endif
Randomizer * Randomizer::rndObj (0);
Randomizer::Randomizer()
{
rndDev = new QFile;
seed = time(0);
diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.h b/pwmanager/pwmanager/setmasterpwwndimpl.h
index 3203d4d..08f3654 100644
--- a/pwmanager/pwmanager/setmasterpwwndimpl.h
+++ b/pwmanager/pwmanager/setmasterpwwndimpl.h
@@ -26,13 +26,17 @@
#else
#include "setmasterpwwnd_emb.h"
#endif
#include <klocale.h>
+#ifdef _WIN32_
+#define uint32_t Q_UINT32
+#else
#include <stdint.h>
+#endif
#include <string>
using std::string;
class PwMKeyCard;
/** set master pw wnd */
diff --git a/pwmanager/pwmanager/sha1.h b/pwmanager/pwmanager/sha1.h
index 29442a7..c649bae 100644
--- a/pwmanager/pwmanager/sha1.h
+++ b/pwmanager/pwmanager/sha1.h
@@ -16,18 +16,23 @@
*
* $Id$
**************************************************************************/
#ifndef SHA1_H
#define SHA1_H
-
+#ifdef _WIN32_
+#define uint32_t unsigned int
+#define uint8_t unsigned char
+#define byte unsigned char
+#else
#include <stdint.h>
+typedef uint8_t byte;
+#endif
#include <string>
using std::string;
-typedef uint8_t byte;
#define SHA1_HASH_LEN_BIT 160
#define SHA1_HASH_LEN_BYTE (SHA1_HASH_LEN_BIT / 8)
/** sha1 hash algorithm.
* Derived from libgcrypt-1.1.12