aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/plp_inttypes.h9
-rw-r--r--lib/Enum.h8
-rw-r--r--lib/rfsv.cc5
-rw-r--r--lib/rfsvfactory.cc4
-rw-r--r--lib/rpcs.cc13
-rw-r--r--lib/rpcsfactory.cc4
-rw-r--r--ncpd/link.cc4
7 files changed, 21 insertions, 26 deletions
diff --git a/include/plp_inttypes.h b/include/plp_inttypes.h
index 0c92d80..acfa7b8 100644
--- a/include/plp_inttypes.h
+++ b/include/plp_inttypes.h
@@ -16,20 +16,11 @@
#endif
#ifndef GNU_INTTYPES
-#ifdef ISO_INTTYPES
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
typedef int64_t s_int64_t;
-#else
-/* Last resort, declare ourselves */
-typedef unsigned char u_int8_t;
-typedef unsigned short u_int16_t;
-typedef unsigned int u_int32_t;
-typedef unsigned long long u_int64_t;
-typedef signed long long s_int64_t;
-#endif // ISO_INTTYPES
#endif // GNU_INTTYPES
#endif // _INTTYPES_H_
diff --git a/lib/Enum.h b/lib/Enum.h
index d4ffe19..5841b2a 100644
--- a/lib/Enum.h
+++ b/lib/Enum.h
@@ -304,14 +304,16 @@ template<typename E> typename Enum<E>::sdata Enum<E>::staticData;
* The definition of the static variable holding the static
* data for this Enumeration wrapper.
*/
-#define ENUM_DEFINITION(EnumName, initWith) \
-template Enum< EnumName >::sdata Enum< EnumName >::staticData; \
+#define ENUM_DEFINITION_BEGIN(EnumName, initWith) \
/** \
* actual definition of the constructor for the static data. \
* This is called implicitly by the definition above. \
*/ \
template <> Enum<EnumName>::sdata::sdata() : \
-name(#EnumName),defaultValue(initWith)
+ name(#EnumName),defaultValue(initWith) {
+
+#define ENUM_DEFINITION_END(EnumName) \
+} template Enum< EnumName >::sdata Enum< EnumName >::staticData;
/**
* Writes enumeration's string representation.
diff --git a/lib/rfsv.cc b/lib/rfsv.cc
index bbc0a90..8d10868 100644
--- a/lib/rfsv.cc
+++ b/lib/rfsv.cc
@@ -33,7 +33,7 @@
using namespace std;
-ENUM_DEFINITION(rfsv::errs, rfsv::E_PSI_GEN_NONE) {
+ENUM_DEFINITION_BEGIN(rfsv::errs, rfsv::E_PSI_GEN_NONE)
stringRep.add(rfsv::E_PSI_GEN_NONE, N_("no error"));
stringRep.add(rfsv::E_PSI_GEN_FAIL, N_("general"));
stringRep.add(rfsv::E_PSI_GEN_ARG, N_("bad argument"));
@@ -108,7 +108,8 @@ ENUM_DEFINITION(rfsv::errs, rfsv::E_PSI_GEN_NONE) {
stringRep.add(rfsv::E_PSI_FILE_HANDLE, N_("bad handle"));
stringRep.add(rfsv::E_PSI_NOT_SIBO, N_("invalid operation for RFSV16"));
stringRep.add(rfsv::E_PSI_INTERNAL, N_("libplp internal error"));
-}
+ENUM_DEFINITION_END(rfsv::errs)
+
const char *rfsv::getConnectName(void) {
return "SYS$RFSV";
diff --git a/lib/rfsvfactory.cc b/lib/rfsvfactory.cc
index f525e5d..e8ff827 100644
--- a/lib/rfsvfactory.cc
+++ b/lib/rfsvfactory.cc
@@ -37,14 +37,14 @@
using namespace std;
-ENUM_DEFINITION(rfsvfactory::errs, rfsvfactory::FACERR_NONE) {
+ENUM_DEFINITION_BEGIN(rfsvfactory::errs, rfsvfactory::FACERR_NONE)
stringRep.add(rfsvfactory::FACERR_NONE, N_("no error"));
stringRep.add(rfsvfactory::FACERR_COULD_NOT_SEND, N_("could not send version request"));
stringRep.add(rfsvfactory::FACERR_AGAIN, N_("try again"));
stringRep.add(rfsvfactory::FACERR_NOPSION, N_("no psion connected"));
stringRep.add(rfsvfactory::FACERR_PROTVERSION, N_("wrong protocol version"));
stringRep.add(rfsvfactory::FACERR_NORESPONSE, N_("no response from ncpd"));
-}
+ENUM_DEFINITION_END(rfsvfactory::errs)
rfsvfactory::rfsvfactory(ppsocket *_skt) : serNum(0)
{
diff --git a/lib/rpcs.cc b/lib/rpcs.cc
index 44c7a76..b5a70d7 100644
--- a/lib/rpcs.cc
+++ b/lib/rpcs.cc
@@ -37,7 +37,7 @@
using namespace std;
-ENUM_DEFINITION(rpcs::machs, rpcs::PSI_MACH_UNKNOWN) {
+ENUM_DEFINITION_BEGIN(rpcs::machs, rpcs::PSI_MACH_UNKNOWN)
stringRep.add(rpcs::PSI_MACH_UNKNOWN, N_("Unknown device"));
stringRep.add(rpcs::PSI_MACH_PC, N_("PC"));
stringRep.add(rpcs::PSI_MACH_MC, N_("MC"));
@@ -49,16 +49,17 @@ ENUM_DEFINITION(rpcs::machs, rpcs::PSI_MACH_UNKNOWN) {
stringRep.add(rpcs::PSI_MACH_S3C, N_("Series 3c"));
stringRep.add(rpcs::PSI_MACH_S5, N_("Series 5"));
stringRep.add(rpcs::PSI_MACH_WINC, N_("WinC"));
-}
+ENUM_DEFINITION_END(rpcs::machs)
-ENUM_DEFINITION(rpcs::batterystates, rpcs::PSI_BATT_DEAD) {
+ENUM_DEFINITION_BEGIN(rpcs::batterystates, rpcs::PSI_BATT_DEAD)
stringRep.add(rpcs::PSI_BATT_DEAD, N_("Empty"));
stringRep.add(rpcs::PSI_BATT_VERYLOW, N_("Very Low"));
stringRep.add(rpcs::PSI_BATT_LOW, N_("Low"));
stringRep.add(rpcs::PSI_BATT_GOOD, N_("Good"));
-}
+ENUM_DEFINITION_END(rpcs::batterystates)
-ENUM_DEFINITION(rpcs::languages, rpcs::PSI_LANG_TEST) {
+
+ENUM_DEFINITION_BEGIN(rpcs::languages, rpcs::PSI_LANG_TEST)
stringRep.add(rpcs::PSI_LANG_TEST, N_("Test"));
stringRep.add(rpcs::PSI_LANG_en_GB, N_("English"));
stringRep.add(rpcs::PSI_LANG_de_DE, N_("German"));
@@ -88,7 +89,7 @@ ENUM_DEFINITION(rpcs::languages, rpcs::PSI_LANG_TEST) {
stringRep.add(rpcs::PSI_LANG_sk_SK, N_("Slovak"));
stringRep.add(rpcs::PSI_LANG_pl_PL, N_("Polish"));
stringRep.add(rpcs::PSI_LANG_sl_SI, N_("Slovenian"));
-}
+ENUM_DEFINITION_END(rpcs::languages)
rpcs::~rpcs()
{
diff --git a/lib/rpcsfactory.cc b/lib/rpcsfactory.cc
index 25a069c..68096f6 100644
--- a/lib/rpcsfactory.cc
+++ b/lib/rpcsfactory.cc
@@ -34,14 +34,14 @@
#include <stdlib.h>
#include <time.h>
-ENUM_DEFINITION(rpcsfactory::errs, rpcsfactory::FACERR_NONE) {
+ENUM_DEFINITION_BEGIN(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"));
stringRep.add(rpcsfactory::FACERR_AGAIN, N_("try again"));
stringRep.add(rpcsfactory::FACERR_NOPSION, N_("no psion connected"));
stringRep.add(rpcsfactory::FACERR_PROTVERSION, N_("wrong protocol version"));
stringRep.add(rpcsfactory::FACERR_NORESPONSE, N_("no response from ncpd"));
-}
+ENUM_DEFINITION_END(rpcsfactory::errs)
rpcsfactory::rpcsfactory(ppsocket *_skt)
{
diff --git a/ncpd/link.cc b/ncpd/link.cc
index 84c1d89..497f723 100644
--- a/ncpd/link.cc
+++ b/ncpd/link.cc
@@ -55,11 +55,11 @@ extern "C" {
using namespace std;
-ENUM_DEFINITION(Link::link_type, Link::LINK_TYPE_UNKNOWN) {
+ENUM_DEFINITION_BEGIN(Link::link_type, Link::LINK_TYPE_UNKNOWN)
stringRep.add(Link::LINK_TYPE_UNKNOWN, N_("Unknown"));
stringRep.add(Link::LINK_TYPE_SIBO, N_("SIBO"));
stringRep.add(Link::LINK_TYPE_EPOC, N_("EPOC"));
-}
+ENUM_DEFINITION_END(Link::link_type)
Link::Link(const char *fname, int baud, ncp *_ncp, unsigned short _verbose)
: p(0)