1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix BSD and Sun problems after coverity fixes

This commit is contained in:
Ulrich Wilkens 2018-05-31 22:47:27 +02:00 committed by Jon Trulson
parent 15fb8cea03
commit 16fbb15ecc
12 changed files with 31 additions and 16 deletions

View file

@ -178,9 +178,12 @@ XCOMM Gnu C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
#ifndef CplusplusLibC #ifndef CplusplusLibC
#define CplusplusLibC -L/opt/solarisstudio/lib -lCrun #define CplusplusLibC -L/opt/solarisstudio/lib -lCrun
#endif #endif
#ifndef OptimizedCplusplusDebugFlags
# define OptimizedCplusplusDebugFlags -O2 -erroff=attrskipunsup
#endif
#ifndef CplusplusDependIncludes #ifndef CplusplusDependIncludes
#if CplusplusCompilerMajorVersion > 3 #if CplusplusCompilerMajorVersion > 3
# define CplusplusDependIncludes -I/opt/solarisstudio/prod/include/CC -I/opt/solarisstudio/prod/include/CC/Cstd # define CplusplusDependIncludes -I/opt/solarisstudio/prod/include/CC -I/opt/solarisstudio/prod/include/CC/Cstd -I/opt/solarisstudio/prod/include/CC/std
#elif CplusplusCompilerMajorVersion > 2 #elif CplusplusCompilerMajorVersion > 2
# define CplusplusDependIncludes -I/opt/SUNWspro/SC3.0/include/CC # define CplusplusDependIncludes -I/opt/SUNWspro/SC3.0/include/CC
#else #else

View file

@ -554,7 +554,6 @@ esc_P_table[] =
{ '0', '9', &_DtTermStateP, _DtTermEnterNum, /* enter number */ }, { '0', '9', &_DtTermStateP, _DtTermEnterNum, /* enter number */ },
{ '|', '|', &_DtTermStateUserKey, _DtTermParseUserKeyClear, /* DECUDK */ }, { '|', '|', &_DtTermStateUserKey, _DtTermParseUserKeyClear, /* DECUDK */ },
{ '{', '{', &_DtTermStateDLCharSet, _DtTermPrimParserNextState, }, { '{', '{', &_DtTermStateDLCharSet, _DtTermPrimParserNextState, },
{ /* down-line-load char set */ },
{ 0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */ }, { 0x00, 0xFF, &stateStart , _DtTermPrintState /* end of table */ },
}; };
StateTableRec _DtTermStateP = {False, esc_P_table, pre_parse_table}; StateTableRec _DtTermStateP = {False, esc_P_table, pre_parse_table};

View file

@ -91,9 +91,13 @@ _Tt_rpc_client(int conn_socket)
_program = 0; _program = 0;
_version = 0; _version = 0;
_server_uid = 0; _server_uid = 0;
_clnt_stat = NULL; _clnt_stat = RPC_SUCCESS;
#if defined(OPT_TLI)
_server_addr = 0;
#else
_server_addr.sin_family = 0; _server_addr.sin_family = 0;
_server_addr.sin_port = 0; _server_addr.sin_port = 0;
#endif
} }

View file

@ -49,7 +49,7 @@ _Tt_observer()
_reliability = TT_DISCARD; _reliability = TT_DISCARD;
_opnum = -1; _opnum = -1;
_scope = NULL; _scope = TT_SCOPE_NONE;
_state = TT_STATE_LAST; // BUG This class member is not set anywhere, but a getter function exists _state = TT_STATE_LAST; // BUG This class member is not set anywhere, but a getter function exists
} }

View file

@ -428,7 +428,7 @@ config_attachment(
attachment = &(obj->attachments->south); attachment = &(obj->attachments->south);
break; break;
default: default:
return; return OK;
} }
if (attachment->type == AB_ATTACH_OBJ) if (attachment->type == AB_ATTACH_OBJ)
{ {

View file

@ -37,6 +37,9 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#if defined(sun)
#include <ieeefp.h>
#endif
#include "calctool.h" #include "calctool.h"
extern char *base_str[] ; /* Strings for each base value. */ extern char *base_str[] ; /* Strings for each base value. */
@ -1729,13 +1732,13 @@ do_round(double result, int ndigits)
int temp; int temp;
if (isnan(result)) return result; if (isnan(result)) return result;
#if defined(_AIX) || defined(__aix) || defined(__sparc) #if defined(_AIX) || defined(__aix) || defined(sun)
temp = finite(result); temp = finite(result);
if (!temp) if (!temp)
return (temp > 0) ? HUGE : -HUGE; return (temp > 0) ? HUGE : -HUGE;
#else #else
if ((temp = isinf(result))) return (temp > 0) ? HUGE : -HUGE; if ((temp = isinf(result))) return (temp > 0) ? HUGE : -HUGE;
#endif /* _AIX or sparc*/ #endif /* _AIX or sun */
if (ndigits >= 0 && ndigits < MAX_DIGITS) if (ndigits >= 0 && ndigits < MAX_DIGITS)
{ {
@ -1843,13 +1846,13 @@ try_compute_i(double guess, double *result, int method)
new_w = w - f / f_prime; new_w = w - f / f_prime;
#if defined(_AIX) || defined(__aix) || defined(__sparc) #if defined(_AIX) || defined(__aix) || defined(sun)
if (!(!isnan(new_w) && finite(new_w))) if (!(!isnan(new_w) && finite(new_w)))
return FALSE; return FALSE;
#else #else
if (!(!isnan(new_w) && !isinf(new_w))) if (!(!isnan(new_w) && !isinf(new_w)))
return FALSE; return FALSE;
#endif /* _AIX or sparc */ #endif /* _AIX or sun */
if (new_w == w || (w != 0.0 && fabs((new_w - w) / w) < FIN_EPSILON)) if (new_w == w || (w != 0.0 && fabs((new_w - w) / w) < FIN_EPSILON))
break; break;

View file

@ -62,6 +62,7 @@
#include <dirent.h> #include <dirent.h>
#include <sys/file.h> #include <sys/file.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "fsrtns.h" #include "fsrtns.h"

View file

@ -77,11 +77,15 @@ btree::btree(const char* store_name)
btree::~btree() btree::~btree()
{ {
if ( btree_DB->sync(btree_DB, 0) == RET_ERROR ) if ( btree_DB->sync(btree_DB, 0) == RET_ERROR ) {
throw(stringException("btree sync failed")); cerr << "btree sync failed";
std::exit(1);
}
if ( btree_DB->close(btree_DB) == RET_ERROR ) if ( btree_DB->close(btree_DB) == RET_ERROR ) {
throw(stringException("btree close failed")); cerr << "btree close failed";
std::exit(1);
}
} }
void btree::clean() void btree::clean()

View file

@ -68,6 +68,8 @@
#endif #endif
#include <cstdlib>
#include "dstr/index_agent.h" #include "dstr/index_agent.h"
#include "btree_berkeley/db.h" #include "btree_berkeley/db.h"

View file

@ -420,7 +420,6 @@ typedef Stack<NTerminal*> _stkNTPtr_;
/* Basic subdir refs */ /* Basic subdir refs */
typedef CC_TPtrDlist<sr_DtCvSegment> _ccTPtrDLstCvSegmnt_; typedef CC_TPtrDlist<sr_DtCvSegment> _ccTPtrDLstCvSegmnt_;
#endif
#endif #endif
#if defined(sun) | defined(hpux) #if defined(sun) | defined(hpux)

View file

@ -1910,7 +1910,7 @@ RunGreeter( struct display *d, struct greet_info *greet,
char *p; char *p;
char **env; char **env;
char *path; char *path;
struct greet_state state = {}; struct greet_state state;
int notify_dt; int notify_dt;
int dupfp = -1; int dupfp = -1;
int dupfp2 = -1; int dupfp2 = -1;

View file

@ -226,7 +226,7 @@ int main(int argc, XeString *argv)
/* Open an error log with whatever name the library wants to use */ /* Open an error log with whatever name the library wants to use */
SPC_Open_Log(log_path, FALSE); SPC_Open_Log(log_path, FALSE);
SPC_Print_Protocol = spc_logF; SPC_Print_Protocol = spc_logF;
if(NULL == (stderr = freopen(log_path, "a", stderr))) { if(NULL == freopen(log_path, "a", stderr)) {
printf("Unable to reopen '%s' as stderr\n", log_path); printf("Unable to reopen '%s' as stderr\n", log_path);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }