Fix BSD and Sun problems after coverity fixes
This commit is contained in:
committed by
Jon Trulson
parent
15fb8cea03
commit
16fbb15ecc
@@ -428,7 +428,7 @@ config_attachment(
|
||||
attachment = &(obj->attachments->south);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return OK;
|
||||
}
|
||||
if (attachment->type == AB_ATTACH_OBJ)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#if defined(sun)
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
#include "calctool.h"
|
||||
|
||||
extern char *base_str[] ; /* Strings for each base value. */
|
||||
@@ -1729,13 +1732,13 @@ do_round(double result, int ndigits)
|
||||
int temp;
|
||||
|
||||
if (isnan(result)) return result;
|
||||
#if defined(_AIX) || defined(__aix) || defined(__sparc)
|
||||
#if defined(_AIX) || defined(__aix) || defined(sun)
|
||||
temp = finite(result);
|
||||
if (!temp)
|
||||
return (temp > 0) ? HUGE : -HUGE;
|
||||
#else
|
||||
if ((temp = isinf(result))) return (temp > 0) ? HUGE : -HUGE;
|
||||
#endif /* _AIX or sparc*/
|
||||
#endif /* _AIX or sun */
|
||||
|
||||
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;
|
||||
|
||||
#if defined(_AIX) || defined(__aix) || defined(__sparc)
|
||||
#if defined(_AIX) || defined(__aix) || defined(sun)
|
||||
if (!(!isnan(new_w) && finite(new_w)))
|
||||
return FALSE;
|
||||
#else
|
||||
if (!(!isnan(new_w) && !isinf(new_w)))
|
||||
return FALSE;
|
||||
#endif /* _AIX or sparc */
|
||||
#endif /* _AIX or sun */
|
||||
|
||||
if (new_w == w || (w != 0.0 && fabs((new_w - w) / w) < FIN_EPSILON))
|
||||
break;
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include <dirent.h>
|
||||
#include <sys/file.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include "fsrtns.h"
|
||||
|
||||
|
||||
|
||||
@@ -77,11 +77,15 @@ btree::btree(const char* store_name)
|
||||
|
||||
btree::~btree()
|
||||
{
|
||||
if ( btree_DB->sync(btree_DB, 0) == RET_ERROR )
|
||||
throw(stringException("btree sync failed"));
|
||||
if ( btree_DB->sync(btree_DB, 0) == RET_ERROR ) {
|
||||
cerr << "btree sync failed";
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
if ( btree_DB->close(btree_DB) == RET_ERROR )
|
||||
throw(stringException("btree close failed"));
|
||||
if ( btree_DB->close(btree_DB) == RET_ERROR ) {
|
||||
cerr << "btree close failed";
|
||||
std::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void btree::clean()
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "dstr/index_agent.h"
|
||||
#include "btree_berkeley/db.h"
|
||||
|
||||
|
||||
@@ -420,7 +420,6 @@ typedef Stack<NTerminal*> _stkNTPtr_;
|
||||
/* Basic subdir refs */
|
||||
typedef CC_TPtrDlist<sr_DtCvSegment> _ccTPtrDLstCvSegmnt_;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(sun) | defined(hpux)
|
||||
|
||||
@@ -1910,7 +1910,7 @@ RunGreeter( struct display *d, struct greet_info *greet,
|
||||
char *p;
|
||||
char **env;
|
||||
char *path;
|
||||
struct greet_state state = {};
|
||||
struct greet_state state;
|
||||
int notify_dt;
|
||||
int dupfp = -1;
|
||||
int dupfp2 = -1;
|
||||
|
||||
@@ -226,7 +226,7 @@ int main(int argc, XeString *argv)
|
||||
/* Open an error log with whatever name the library wants to use */
|
||||
SPC_Open_Log(log_path, FALSE);
|
||||
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);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user