aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2003-02-05 07:59:09 +0000
committerFritz Elfert <felfert@to.com>2003-02-05 07:59:09 +0000
commitf0c047e1f40ee2214fe1f73dc3bdc6b0f6de5d85 (patch)
tree166bf2df5ca4fc40904af30a56a0de88683baf8d /lib
parent27ba222abbf3137eef49e31ac521de01d39c8088 (diff)
downloadplptools-f0c047e1f40ee2214fe1f73dc3bdc6b0f6de5d85.tar.gz
plptools-f0c047e1f40ee2214fe1f73dc3bdc6b0f6de5d85.tar.bz2
plptools-f0c047e1f40ee2214fe1f73dc3bdc6b0f6de5d85.zip
- Changes for compiling with gcc 3.2
Diffstat (limited to 'lib')
-rw-r--r--lib/Enum.cc4
-rw-r--r--lib/Enum.h4
-rw-r--r--lib/bufferarray.cc6
-rw-r--r--lib/bufferarray.h1
-rw-r--r--lib/bufferstore.cc9
-rw-r--r--lib/bufferstore.h3
-rw-r--r--lib/iowatch.cc9
-rw-r--r--lib/log.cc5
-rw-r--r--lib/log.h17
-rw-r--r--lib/plpdirent.cc2
-rw-r--r--lib/plpdirent.h4
-rw-r--r--lib/ppsocket.cc11
-rw-r--r--lib/ppsocket.h1
-rw-r--r--lib/psibitmap.cpp20
-rw-r--r--lib/psiprocess.cc8
-rw-r--r--lib/psiprocess.h2
-rw-r--r--lib/psitime.cc7
-rw-r--r--lib/psitime.h15
-rw-r--r--lib/rclip.cc16
-rw-r--r--lib/rclip.h2
-rw-r--r--lib/rfsv.cc4
-rw-r--r--lib/rfsv.h7
-rw-r--r--lib/rfsv16.cc14
-rw-r--r--lib/rfsv32.cc23
-rw-r--r--lib/rfsvfactory.cc10
-rw-r--r--lib/rfsvfactory.h2
-rw-r--r--lib/rpcs.cc41
-rw-r--r--lib/rpcs.h9
-rw-r--r--lib/rpcs16.cc12
-rw-r--r--lib/rpcs32.cc14
-rw-r--r--lib/rpcsfactory.cc11
-rw-r--r--lib/rpcsfactory.h2
-rw-r--r--lib/siscomponentrecord.cpp8
-rw-r--r--lib/siscomponentrecord.h2
-rw-r--r--lib/sisfile.h6
-rw-r--r--lib/sisfileheader.h12
-rw-r--r--lib/sisfilerecord.h2
-rw-r--r--lib/sislangrecord.h2
-rw-r--r--lib/sisreqrecord.h2
-rw-r--r--lib/sistypes.h6
-rw-r--r--lib/wprt.cc14
-rw-r--r--lib/wprt.h2
42 files changed, 175 insertions, 176 deletions
diff --git a/lib/Enum.cc b/lib/Enum.cc
index 2c4142b..9e5b725 100644
--- a/lib/Enum.cc
+++ b/lib/Enum.cc
@@ -20,6 +20,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "Enum.h"
using namespace std;
diff --git a/lib/Enum.h b/lib/Enum.h
index ba410f9..11a2371 100644
--- a/lib/Enum.h
+++ b/lib/Enum.h
@@ -27,11 +27,11 @@
#include <config.h>
#endif
-#include <plpintl.h>
-
#include <map>
#include <string>
+#include <plpintl.h>
+
/**
* the Base for the Enum template.
* currently, only purpose is to provide a class type for mapping
diff --git a/lib/bufferarray.cc b/lib/bufferarray.cc
index 65f2acf..a060af6 100644
--- a/lib/bufferarray.cc
+++ b/lib/bufferarray.cc
@@ -21,9 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
-#include <stream.h>
-#include <iomanip.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include "bufferstore.h"
#include "bufferarray.h"
diff --git a/lib/bufferarray.h b/lib/bufferarray.h
index 59554e3..c3781b0 100644
--- a/lib/bufferarray.h
+++ b/lib/bufferarray.h
@@ -27,6 +27,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
class bufferStore;
/**
diff --git a/lib/bufferstore.cc b/lib/bufferstore.cc
index 4712c45..17e4b9b 100644
--- a/lib/bufferstore.cc
+++ b/lib/bufferstore.cc
@@ -25,16 +25,17 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <stream.h>
+
+#include "bufferstore.h"
+
// Should be iostream.h, but won't build on Sun WorkShop C++ 5.0
#include <iomanip>
+#include <string>
+
#include <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include <assert.h>
-#include "bufferstore.h"
-
using namespace std;
bufferStore::bufferStore()
diff --git a/lib/bufferstore.h b/lib/bufferstore.h
index 0e951b8..9472301 100644
--- a/lib/bufferstore.h
+++ b/lib/bufferstore.h
@@ -24,8 +24,9 @@
#ifndef _BUFFERSTORE_H_
#define _BUFFERSTORE_H_
+#include <iostream>
+
#include <sys/types.h>
-#include <stream.h>
/**
* A generic container for an array of bytes.
diff --git a/lib/iowatch.cc b/lib/iowatch.cc
index 5a975f7..7c320f8 100644
--- a/lib/iowatch.cc
+++ b/lib/iowatch.cc
@@ -21,15 +21,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "iowatch.h"
+
#include <unistd.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <stream.h>
#include <memory.h>
-#include "iowatch.h"
-
IOWatch::IOWatch() {
num = 0;
io = new int [FD_SETSIZE];
diff --git a/lib/log.cc b/lib/log.cc
index fada4f5..6735fea 100644
--- a/lib/log.cc
+++ b/lib/log.cc
@@ -22,13 +22,14 @@
*
*/
#include "log.h"
+
#include <unistd.h>
-logbuf::logbuf(int level, int fd) {
+logbuf::logbuf(int loglevel, int fd) {
ptr = buf;
len = 0;
_on = true;
- _level = level;
+ _level = loglevel;
_fd = fd;
}
diff --git a/lib/log.h b/lib/log.h
index 9f629e1..01ffe83 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -24,7 +24,8 @@
#ifndef _LOG_H_
#define _LOG_H_
-#include <ostream.h>
+#include <iostream>
+
#include <syslog.h>
/**
@@ -51,32 +52,32 @@
* file. If it is omitted or set to -1, logging can be switched on
* or off. The initial state is on.
*/
-class logbuf : public streambuf {
+class logbuf : public std::streambuf {
public:
/**
* Constructs a new instance.
*
- * @param level The log level for this instance.
+ * @param loglevel The log level for this instance.
* see syslog(3) for symbolic names to use.
* @param fd An optional file descriptor to use
* if switched off.
*/
- logbuf(int level, int fd = -1);
+ logbuf(int loglevel, int fd = -1);
/**
* Switches loggin on or off.
*
- * @param on The desired state.
+ * @param newstate The desired state.
*/
- void setOn(bool on) { _on = on; }
+ void setOn(bool newstate) { _on = newstate; }
/**
* Modifies the loglevel of this instance.
*
- * @param level The new loglevel.
+ * @param newlevel The new loglevel.
*/
- void setLevel(int level) { _level = level; }
+ void setLevel(int newlevel) { _level = newlevel; }
/**
* Retrieve the current state.
diff --git a/lib/plpdirent.cc b/lib/plpdirent.cc
index 813e1d5..5d05bc6 100644
--- a/lib/plpdirent.cc
+++ b/lib/plpdirent.cc
@@ -21,7 +21,7 @@
*
*/
#include "plpdirent.h"
-#include <stream.h>
+
#include <iomanip>
using namespace std;
diff --git a/lib/plpdirent.h b/lib/plpdirent.h
index 5eeced7..a611225 100644
--- a/lib/plpdirent.h
+++ b/lib/plpdirent.h
@@ -23,7 +23,9 @@
#ifndef _PLPDIRENT_H_
#define _PLPDIRENT_H_
+#include <iostream>
#include <string>
+
#include <psitime.h>
#include <rfsv.h>
@@ -175,7 +177,7 @@ public:
* The output is in human readable similar to the
* output of a "ls" command.
*/
- friend ostream &operator<<(ostream &o, const PlpDirent &e);
+ friend std::ostream &operator<<(std::ostream &o, const PlpDirent &e);
private:
u_int32_t size;
diff --git a/lib/ppsocket.cc b/lib/ppsocket.cc
index 6632241..a624d8d 100644
--- a/lib/ppsocket.cc
+++ b/lib/ppsocket.cc
@@ -25,10 +25,15 @@
#include "config.h"
#endif
+#include "bufferstore.h"
+#include "ppsocket.h"
+#include "iowatch.h"
+
+#include <iostream>
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-#include <iostream.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@@ -38,10 +43,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-#include "bufferstore.h"
-#include "ppsocket.h"
-#include "iowatch.h"
-
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
diff --git a/lib/ppsocket.h b/lib/ppsocket.h
index 4abecca..b63f3a0 100644
--- a/lib/ppsocket.h
+++ b/lib/ppsocket.h
@@ -25,6 +25,7 @@
#define _PPSOCKET_H_
#include <string>
+
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
diff --git a/lib/psibitmap.cpp b/lib/psibitmap.cpp
index ffe97ea..3dfd125 100644
--- a/lib/psibitmap.cpp
+++ b/lib/psibitmap.cpp
@@ -142,17 +142,17 @@ do { \
bool
decodeBitmap(const unsigned char *p, int &width, int &height, bufferStore &out)
{
- u_int32_t totlen = *((u_int32_t*)p); p += 4;
- u_int32_t hdrlen = *((u_int32_t*)p); p += 4;
+ u_int32_t totlen = *((const u_int32_t*)p); p += 4;
+ u_int32_t hdrlen = *((const u_int32_t*)p); p += 4;
u_int32_t datlen = totlen - hdrlen;
- u_int32_t xPixels = *((u_int32_t*)p); p += 4;
- u_int32_t yPixels = *((u_int32_t*)p); p += 4;
- u_int32_t xTwips = *((u_int32_t*)p); p += 4;
- u_int32_t yTwips = *((u_int32_t*)p); p += 4;
- u_int32_t bitsPerPixel = *((u_int32_t*)p); p += 4;
- u_int32_t unknown1 = *((u_int32_t*)p); p += 4;
- u_int32_t unknown2 = *((u_int32_t*)p); p += 4;
- u_int32_t RLEflag = *((u_int32_t*)p); p += 4;
+ u_int32_t xPixels = *((const u_int32_t*)p); p += 4;
+ u_int32_t yPixels = *((const u_int32_t*)p); p += 4;
+ u_int32_t xTwips = *((const u_int32_t*)p); p += 4;
+ u_int32_t yTwips = *((const u_int32_t*)p); p += 4;
+ u_int32_t bitsPerPixel = *((const u_int32_t*)p); p += 4;
+ u_int32_t unknown1 = *((const u_int32_t*)p); p += 4;
+ u_int32_t unknown2 = *((const u_int32_t*)p); p += 4;
+ u_int32_t RLEflag = *((const u_int32_t*)p); p += 4;
width = xPixels;
height = yPixels;
diff --git a/lib/psiprocess.cc b/lib/psiprocess.cc
index d868820..ad1349d 100644
--- a/lib/psiprocess.cc
+++ b/lib/psiprocess.cc
@@ -21,8 +21,8 @@
*
*/
#include "psiprocess.h"
-#include <stream.h>
-#include <strstream>
+
+#include <sstream>
#include <iomanip>
using namespace std;
@@ -63,13 +63,13 @@ getArgs() {
const char *PsiProcess::
getProcId() {
- ostrstream tmp;
+ ostringstream tmp;
if (s5mx)
tmp << name << ".$" << setw(2) << setfill('0') << pid << '\0';
else
tmp << name << ".$" << pid << '\0';
- return tmp.str();
+ return tmp.str().c_str();
}
void PsiProcess::
diff --git a/lib/psiprocess.h b/lib/psiprocess.h
index 3e76d8e..f116119 100644
--- a/lib/psiprocess.h
+++ b/lib/psiprocess.h
@@ -24,7 +24,7 @@
#define _PSIPROCESS_H_
#include <string>
-#include <stream.h>
+#include <iostream>
class rpcs;
diff --git a/lib/psitime.cc b/lib/psitime.cc
index 07b2d5a..61a74fa 100644
--- a/lib/psitime.cc
+++ b/lib/psitime.cc
@@ -21,11 +21,14 @@
*
*/
#include "psitime.h"
+#include "plp_inttypes.h"
+
#include <stdlib.h>
-#include <plp_inttypes.h>
#define OnePM 3600 // 13:00 offset for SIBO
+using namespace std;
+
PsiTime::PsiTime(void) {
ptzValid = false;
tryPsiZone();
@@ -63,7 +66,7 @@ PsiTime::PsiTime(const u_int32_t _ptvHi, const u_int32_t _ptvLo) {
psi2unix();
}
-PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz = 0L) {
+PsiTime::PsiTime(struct timeval *_utv, struct timezone *_utz) {
if (_utv != 0L)
utv = *_utv;
if (_utz != 0L)
diff --git a/lib/psitime.h b/lib/psitime.h
index 79fd521..73a5c87 100644
--- a/lib/psitime.h
+++ b/lib/psitime.h
@@ -27,6 +27,8 @@
#include <config.h>
#endif
+#include <iostream>
+
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
@@ -41,7 +43,6 @@
#include <unistd.h>
#include <sys/types.h>
-#include <ostream.h>
#include <plpintl.h>
/**
@@ -54,8 +55,8 @@ typedef struct psi_timeval_t {
/**
* Prints a psi_timeval in human readable format.
*/
- friend ostream &operator<<(ostream &o, const psi_timeval_t &ptv) {
- ostream::fmtflags old = o.flags();
+ friend std::ostream &operator<<(std::ostream &o, const psi_timeval_t &ptv) {
+ std::ostream::fmtflags old = o.flags();
u_int64_t micro = ptv.tv_high;
micro = (micro << 32) | ptv.tv_low;
micro /= 1000000;
@@ -95,8 +96,8 @@ typedef struct psi_timeval_t {
* holds a Psion time zone description.
*/
typedef struct psi_timezone_t {
- friend ostream &operator<<(ostream &s, const psi_timezone_t &ptz) {
- ostream::fmtflags old = s.flags();
+ friend std::ostream &operator<<(std::ostream &s, const psi_timezone_t &ptz) {
+ std::ostream::fmtflags old = s.flags();
int h = ptz.utc_offset / 3600;
int m = ptz.utc_offset % 3600;
s << "offs: " << std::dec << h << "h";
@@ -291,7 +292,7 @@ public:
*
* @returns The stream.
*/
- friend ostream &operator<<(ostream &s, const PsiTime &t);
+ friend std::ostream &operator<<(std::ostream &s, const PsiTime &t);
/**
* Assignment operator
@@ -310,7 +311,7 @@ public:
PSI_TZ_EUROPEAN = 1,
PSI_TZ_NORTHERN = 2,
PSI_TZ_SOUTHERN = 4,
- PSI_TZ_HOME = 0x40000000,
+ PSI_TZ_HOME = 0x40000000
};
private:
diff --git a/lib/rclip.cc b/lib/rclip.cc
index 91870cc..09a6dde 100644
--- a/lib/rclip.cc
+++ b/lib/rclip.cc
@@ -24,18 +24,14 @@
#include "config.h"
#endif
-#include <stream.h>
+#include "rclip.h"
+#include "bufferstore.h"
+#include "ppsocket.h"
+#include "bufferarray.h"
+#include "Enum.h"
+
#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
#include <time.h>
-#include <string.h>
-
-#include <rclip.h>
-#include <bufferstore.h>
-#include <ppsocket.h>
-#include <bufferarray.h>
-#include <Enum.h>
rclip::rclip(ppsocket * _skt)
{
diff --git a/lib/rclip.h b/lib/rclip.h
index dd1563b..7bdeca0 100644
--- a/lib/rclip.h
+++ b/lib/rclip.h
@@ -143,7 +143,7 @@ protected:
enum commands {
RCLIP_INIT = 0x00,
RCLIP_NOTIFY = 0x08,
- RCLIP_LISTEN = 0x04,
+ RCLIP_LISTEN = 0x04
};
/**
diff --git a/lib/rfsv.cc b/lib/rfsv.cc
index 017d743..bbc0a90 100644
--- a/lib/rfsv.cc
+++ b/lib/rfsv.cc
@@ -22,6 +22,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "rfsv.h"
#include "ppsocket.h"
#include "bufferstore.h"
diff --git a/lib/rfsv.h b/lib/rfsv.h
index 9b75b5e..fb48085 100644
--- a/lib/rfsv.h
+++ b/lib/rfsv.h
@@ -26,6 +26,7 @@
#include <deque>
#include <string>
+
#include <Enum.h>
#include <plpdirent.h>
#include <bufferstore.h>
@@ -91,7 +92,7 @@ public:
enum open_flags {
PSI_O_RDONLY = 0000,
PSI_O_WRONLY = 0001,
- PSI_O_RDWR = 0002,
+ PSI_O_RDWR = 0002
};
/**
@@ -102,7 +103,7 @@ public:
PSI_O_EXCL = 00200,
PSI_O_TRUNC = 01000,
PSI_O_APPEND = 02000,
- PSI_O_SHARE = 04000,
+ PSI_O_SHARE = 04000
};
/**
@@ -210,7 +211,7 @@ public:
PSI_A_READ = 0x0200,
PSI_A_EXEC = 0x0400,
PSI_A_STREAM = 0x0800,
- PSI_A_TEXT = 0x1000,
+ PSI_A_TEXT = 0x1000
};
virtual ~rfsv();
diff --git a/lib/rfsv16.cc b/lib/rfsv16.cc
index 09b78e2..afa9207 100644
--- a/lib/rfsv16.cc
+++ b/lib/rfsv16.cc
@@ -26,18 +26,17 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip>
-#include <time.h>
-#include <string>
-
#include "rfsv16.h"
#include "bufferstore.h"
#include "ppsocket.h"
#include "bufferarray.h"
+#include <iostream>
+#include <fstream>
+
+#include <stdlib.h>
+#include <time.h>
+
#define RFSV16_MAXDATALEN 852 // 640
using namespace std;
@@ -347,7 +346,6 @@ devlist(u_int32_t &devbits)
return status;
while (1) {
- bufferStore a;
a.init();
a.addWord(fileHandle & 0xFFFF);
if (!sendCommand(FDEVICEREAD, a))
diff --git a/lib/rfsv32.cc b/lib/rfsv32.cc
index ae12711..2574926 100644
--- a/lib/rfsv32.cc
+++ b/lib/rfsv32.cc
@@ -25,19 +25,18 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdlib.h>
-#include <fstream>
-#include <iomanip>
-#include <time.h>
-#include <string>
-
#include "rfsv32.h"
#include "bufferstore.h"
#include "ppsocket.h"
#include "bufferarray.h"
#include "plpdirent.h"
+#include <iostream>
+#include <fstream>
+
+#include <stdlib.h>
+#include <time.h>
+
using namespace std;
rfsv32::rfsv32(ppsocket * _skt)
@@ -856,14 +855,14 @@ static enum rfsv::errs e2psi[] = {
};
Enum<rfsv::errs> rfsv32::
-err2psierr(int32_t status)
+err2psierr(int32_t istatus)
{
- if ((status > E_EPOC_NONE) || (status < E_EPOC_DIR_FULL)) {
- cerr << "FATAL: inavlid error-code" << endl;
- cerr << "status: " << status << " " << hex << status << endl;
+ if ((istatus > E_EPOC_NONE) || (istatus < E_EPOC_DIR_FULL)) {
+ cerr << "FATAL: invalid error-code" << endl;
+ cerr << "status: " << istatus << " " << hex << istatus << endl;
return E_PSI_INTERNAL;
}
- return e2psi[status - E_EPOC_DIR_FULL];
+ return e2psi[istatus - E_EPOC_DIR_FULL];
}
diff --git a/lib/rfsvfactory.cc b/lib/rfsvfactory.cc
index 46de414..f525e5d 100644
--- a/lib/rfsvfactory.cc
+++ b/lib/rfsvfactory.cc
@@ -24,13 +24,6 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "rfsv.h"
#include "rfsv16.h"
#include "rfsv32.h"
@@ -39,6 +32,9 @@
#include "ppsocket.h"
#include "Enum.h"
+#include <stdlib.h>
+#include <time.h>
+
using namespace std;
ENUM_DEFINITION(rfsvfactory::errs, rfsvfactory::FACERR_NONE) {
diff --git a/lib/rfsvfactory.h b/lib/rfsvfactory.h
index add4a20..a4f8918 100644
--- a/lib/rfsvfactory.h
+++ b/lib/rfsvfactory.h
@@ -45,7 +45,7 @@ public:
FACERR_AGAIN = 2,
FACERR_NOPSION = 3,
FACERR_PROTVERSION = 4,
- FACERR_NORESPONSE = 5,
+ FACERR_NORESPONSE = 5
};
/**
diff --git a/lib/rpcs.cc b/lib/rpcs.cc
index 4a310f0..48298b8 100644
--- a/lib/rpcs.cc
+++ b/lib/rpcs.cc
@@ -24,14 +24,6 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "rpcs.h"
#include "bufferstore.h"
#include "ppsocket.h"
@@ -39,6 +31,10 @@
#include "psiprocess.h"
#include "Enum.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
using namespace std;
ENUM_DEFINITION(rpcs::machs, rpcs::PSI_MACH_UNKNOWN) {
@@ -387,23 +383,20 @@ getOwnerInfo(bufferArray &owner)
if ((res = (enum rfsv::errs)getResponse(a, true)) != rfsv::E_PSI_GEN_NONE)
return res;
a.addByte(0);
- int l = a.getLen();
- char *s = (char *)a.getString(0);
- for (int i = 0; i < l; i++)
- if (s[i] == 6)
- s[i] = 0;
+ string s = a.getString(0);
owner.clear();
- while (l > 0) {
- if (*s != '\0') {
- bufferStore b;
- b.addStringT(s);
- owner += b;
- l -= (strlen(s) + 1);
- s += (strlen(s) + 1);
- } else {
- l--;
- s++;
- }
+ int p = 0;
+ int l;
+ while ((l = s.find('\006', p)) != s.npos) {
+ bufferStore b;
+ b.addStringT(s.substr(p, l - p).c_str());
+ owner += b;
+ p = l + 1;
+ }
+ if (s.substr(p).length()) {
+ bufferStore b;
+ b.addStringT(s.substr(p).c_str());
+ owner += b;
}
return res;
}
diff --git a/lib/rpcs.h b/lib/rpcs.h
index 5834afa..de3004f 100644
--- a/lib/rpcs.h
+++ b/lib/rpcs.h
@@ -23,12 +23,13 @@
#ifndef _RPCS_H_
#define _RPCS_H_
-#include <vector>
#include <psitime.h>
#include <psiprocess.h>
#include <rfsv.h>
#include <Enum.h>
+#include <vector>
+
class ppsocket;
class bufferStore;
class bufferArray;
@@ -66,7 +67,7 @@ public:
PSI_MACH_SIENNA = 7,
PSI_MACH_S3C = 8,
PSI_MACH_S5 = 32,
- PSI_MACH_WINC = 33,
+ PSI_MACH_WINC = 33
// TODO: Code for 5mx
};
@@ -102,7 +103,7 @@ public:
PSI_LANG_cs_CZ = 25,
PSI_LANG_sk_SK = 26,
PSI_LANG_pl_PL = 27,
- PSI_LANG_sl_SI = 28,
+ PSI_LANG_sl_SI = 28
};
/**
@@ -112,7 +113,7 @@ public:
PSI_BATT_DEAD = 0,
PSI_BATT_VERYLOW = 1,
PSI_BATT_LOW = 2,
- PSI_BATT_GOOD = 3,
+ PSI_BATT_GOOD = 3
};
/**
diff --git a/lib/rpcs16.cc b/lib/rpcs16.cc
index 3a2b59a..603fcb9 100644
--- a/lib/rpcs16.cc
+++ b/lib/rpcs16.cc
@@ -25,19 +25,15 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "rpcs16.h"
#include "bufferstore.h"
#include "bufferarray.h"
#include "ppsocket.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
using namespace std;
rpcs16::rpcs16(ppsocket * _skt)
diff --git a/lib/rpcs32.cc b/lib/rpcs32.cc
index b8874f1..0e9122c 100644
--- a/lib/rpcs32.cc
+++ b/lib/rpcs32.cc
@@ -24,19 +24,17 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "rpcs32.h"
#include "bufferstore.h"
#include "bufferarray.h"
#include "ppsocket.h"
+#include <iostream>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
using namespace std;
rpcs32::rpcs32(ppsocket * _skt)
diff --git a/lib/rpcsfactory.cc b/lib/rpcsfactory.cc
index 0861c2c..25a069c 100644
--- a/lib/rpcsfactory.cc
+++ b/lib/rpcsfactory.cc
@@ -24,21 +24,16 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "rpcs16.h"
#include "rpcs32.h"
#include "rpcsfactory.h"
#include "bufferstore.h"
#include "ppsocket.h"
-
#include "Enum.h"
+#include <stdlib.h>
+#include <time.h>
+
ENUM_DEFINITION(rpcsfactory::errs, rpcsfactory::FACERR_NONE) {
stringRep.add(rpcsfactory::FACERR_NONE, N_("no error"));
stringRep.add(rpcsfactory::FACERR_COULD_NOT_SEND, N_("could not send version request"));
diff --git a/lib/rpcsfactory.h b/lib/rpcsfactory.h
index c00388c..614695a 100644
--- a/lib/rpcsfactory.h
+++ b/lib/rpcsfactory.h
@@ -44,7 +44,7 @@ class rpcsfactory {
FACERR_AGAIN = 2,
FACERR_NOPSION = 3,
FACERR_PROTVERSION = 4,
- FACERR_NORESPONSE = 5,
+ FACERR_NORESPONSE = 5
};
/**
diff --git a/lib/siscomponentrecord.cpp b/lib/siscomponentrecord.cpp
index ac5ba6d..de382ad 100644
--- a/lib/siscomponentrecord.cpp
+++ b/lib/siscomponentrecord.cpp
@@ -83,10 +83,10 @@ SISComponentNameRecord::fillFrom(uint8_t* buf, int* basePos, off_t len,
sisFile->getLanguage(i)->m_name,
m_nameLengths[i],
buf + m_namePtrs[i]);
- int len = m_nameLengths[i];
- m_names[i] = new uint8_t[len + 1];
- memcpy(m_names[i], buf + m_namePtrs[i], len);
- m_names[i][len] = 0;
+ int nlen = m_nameLengths[i];
+ m_names[i] = new uint8_t[nlen + 1];
+ memcpy(m_names[i], buf + m_namePtrs[i], nlen);
+ m_names[i][nlen] = 0;
}
if (logLevel >= 1)
printf(_("%d .. %d (%d bytes): Name records\n"), base, base + size, size);
diff --git a/lib/siscomponentrecord.h b/lib/siscomponentrecord.h
index 1fc4ff3..1495c74 100644
--- a/lib/siscomponentrecord.h
+++ b/lib/siscomponentrecord.h
@@ -23,7 +23,7 @@
#ifndef _SISCOMPONENTRECORD_H
#define _SISCOMPONENTRECORD_H
-#include "sistypes.h"
+#include <sistypes.h>
class SISFile;
diff --git a/lib/sisfile.h b/lib/sisfile.h
index bb33570..7a9d6da 100644
--- a/lib/sisfile.h
+++ b/lib/sisfile.h
@@ -23,9 +23,9 @@
#ifndef _SISFILE_H
#define _SISFILE_H
-#include "sistypes.h"
-#include "sisfileheader.h"
-#include "siscomponentrecord.h"
+#include <sistypes.h>
+#include <sisfileheader.h>
+#include <siscomponentrecord.h>
class SISLangRecord;
class SISFileRecord;
diff --git a/lib/sisfileheader.h b/lib/sisfileheader.h
index 0c2d635..ba32cb5 100644
--- a/lib/sisfileheader.h
+++ b/lib/sisfileheader.h
@@ -23,7 +23,7 @@
#ifndef _SISFILEHEADER_H
#define _SISFILEHEADER_H
-#include "sistypes.h"
+#include <sistypes.h>
/**
* The first part of a SISFile.
@@ -62,21 +62,23 @@ public:
enum FileOptions {
op_isUnicode = 1,
- op_isDistributable = 2,
+ op_isDistributable = 2
#ifdef EPOC6
+ ,
op_noCompress = 8,
- op_shutdownApps = 16,
+ op_shutdownApps = 16
#endif
};
enum FileType {
- FT_App = 0,
+ FT_App = 0
#ifdef EPOC6
+ ,
FT_System = 1,
FT_Option = 2,
FT_Config = 3,
FT_Patch = 4,
- FT_Upgrade = 5,
+ FT_Upgrade = 5
#endif
};
diff --git a/lib/sisfilerecord.h b/lib/sisfilerecord.h
index 96a5f2a..6c0e641 100644
--- a/lib/sisfilerecord.h
+++ b/lib/sisfilerecord.h
@@ -23,7 +23,7 @@
#ifndef _SISFILERECORD_H
#define _SISFILERECORD_H
-#include "sistypes.h"
+#include <sistypes.h>
class SISFile;
diff --git a/lib/sislangrecord.h b/lib/sislangrecord.h
index 4b6e7ae..89b1af0 100644
--- a/lib/sislangrecord.h
+++ b/lib/sislangrecord.h
@@ -23,7 +23,7 @@
#ifndef _SISLANGRECORD_H
#define _SISLANGRECORD_H
-#include "sistypes.h"
+#include <sistypes.h>
/**
* A simple language record, only containing the epoc specific 16 bit
diff --git a/lib/sisreqrecord.h b/lib/sisreqrecord.h
index 12bf535..89762ea 100644
--- a/lib/sisreqrecord.h
+++ b/lib/sisreqrecord.h
@@ -23,7 +23,7 @@
#ifndef _SISREQRECORD_H
#define _SISREQRECORD_H
-#include "sistypes.h"
+#include <sistypes.h>
class SISFile;
diff --git a/lib/sistypes.h b/lib/sistypes.h
index 131c4dc..04c94cc 100644
--- a/lib/sistypes.h
+++ b/lib/sistypes.h
@@ -23,7 +23,7 @@
#ifndef _SISTYPES_H
#define _SISTYPES_H
-#include "plp_inttypes.h"
+#include <plp_inttypes.h>
/**
* Return Codes.
@@ -38,7 +38,7 @@ enum SisRC {
SIS_DIFFERENT_APP,
SIS_VER_EARLIER,
SIS_SAME_OR_LATER,
- SIS_OTHER_VARIANT,
+ SIS_OTHER_VARIANT
};
extern uint16_t read16(uint8_t* p);
@@ -61,7 +61,7 @@ struct LangTableEntry
{
uint16_t m_no;
char m_code[3];
- char* m_name;
+ const char* m_name;
};
extern LangTableEntry langTable[];
diff --git a/lib/wprt.cc b/lib/wprt.cc
index 42d0308..5ba2f86 100644
--- a/lib/wprt.cc
+++ b/lib/wprt.cc
@@ -24,19 +24,19 @@
#include "config.h"
#endif
-#include <stream.h>
-#include <stdlib.h>
-#include <fstream.h>
-#include <iomanip.h>
-#include <time.h>
-#include <string.h>
-
#include "wprt.h"
#include "bufferstore.h"
#include "ppsocket.h"
#include "bufferarray.h"
#include "Enum.h"
+#include <iostream>
+
+#include <stdlib.h>
+#include <time.h>
+
+using namespace std;
+
wprt::wprt(ppsocket * _skt)
{
skt = _skt;
diff --git a/lib/wprt.h b/lib/wprt.h
index 755c2b9..a978f20 100644
--- a/lib/wprt.h
+++ b/lib/wprt.h
@@ -93,7 +93,7 @@ protected:
WPRT_INIT = 0x00,
WPRT_GET = 0xf0,
WPRT_CANCEL = 0xf1,
- WPRT_STOP = 0xff,
+ WPRT_STOP = 0xff
};
/**