mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtinfo subtree DtMmdb
This commit is contained in:
parent
b92cf08899
commit
8c8363f4a5
184 changed files with 1090 additions and 773 deletions
|
@ -37,11 +37,7 @@ public:
|
|||
DECLARE_EXCEPTION(hardCopyRendererException, Exception);
|
||||
};
|
||||
|
||||
#if defined(linux)
|
||||
#define CASTHCREXCEPT (hardCopyRendererException*)
|
||||
#else
|
||||
#define CASTHCREXCEPT
|
||||
#endif
|
||||
|
||||
#endif /* _FPExceptions_h */
|
||||
/* DO NOT ADD ANY LINES AFTER THIS #endif */
|
||||
|
|
|
@ -186,7 +186,7 @@ featureProcessor::getFeatureValueArray(const Feature* f)
|
|||
if ( f -> value() -> type() == FeatureValue::array )
|
||||
return (FeatureValueArray*)(f -> value());
|
||||
else {
|
||||
MESSAGE(cerr, form("%s is not of an array type.", f -> name()));
|
||||
MESSAGE(cerr, form("%s is not of an array type.", f -> name().name()));
|
||||
throw(CASTHCREXCEPT hardCopyRendererException());
|
||||
}
|
||||
} else
|
||||
|
|
|
@ -25,13 +25,15 @@
|
|||
#ifndef _fp_h
|
||||
#define _fp_h 1
|
||||
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include "FPExceptions.h"
|
||||
#include "StyleSheet/Feature.h"
|
||||
#include "StyleSheet/FeatureValue.h"
|
||||
#include "StyleSheet/Element.h"
|
||||
#include "StyleSheet/Const.h"
|
||||
#include "StyleSheet/Debug.h"
|
||||
#include "utility/funcs.h"
|
||||
|
||||
enum BLOCK_MODE { NON_BLOCK, BLOCK };
|
||||
extern enum BLOCK_MODE g_block_mode;
|
||||
|
|
|
@ -23,7 +23,11 @@
|
|||
// $TOG: autoNumber.C /main/6 1998/04/17 11:47:13 mgreess $
|
||||
|
||||
#include <ctype.h>
|
||||
#if defined(CSRG_BASED)
|
||||
#define MAXINT INT_MAX
|
||||
#else
|
||||
#include <values.h>
|
||||
#endif
|
||||
|
||||
#include "HardCopy/autoNumber.h"
|
||||
#include "HardCopy/FPExceptions.h"
|
||||
|
@ -137,7 +141,7 @@ autoNumberNumeric::getValue()
|
|||
char* ptr = f_buf.get_base();
|
||||
|
||||
if (f_values.entries())
|
||||
sprintf(ptr, form("%s%d%s", f_prefix, f_values.top(), f_postfix));
|
||||
sprintf(ptr, "%s", form("%s%d%s", f_prefix, f_values.top(), f_postfix));
|
||||
else
|
||||
*ptr = 0;
|
||||
|
||||
|
@ -291,10 +295,12 @@ const char* autoNumberAlphabetic::intToAlpha(int x, enum CaseType a_case)
|
|||
x = z;
|
||||
}
|
||||
|
||||
for (int k=0; k<digits-i; k++ )
|
||||
int k;
|
||||
for (k=0; k<digits-i; k++ )
|
||||
buf[k] = letters[0];
|
||||
|
||||
for (int n=0; n<i; n++ )
|
||||
int n;
|
||||
for (n=0; n<i; n++ )
|
||||
buf[k+n] = buf1[n];
|
||||
|
||||
buf[k+n] = 0;
|
||||
|
@ -317,7 +323,7 @@ const char* autoNumberAlphabetic::getValue()
|
|||
char* ptr = f_buf.get_base();
|
||||
|
||||
if (f_values.entries())
|
||||
sprintf(ptr, form("%s%s%s", f_prefix,
|
||||
sprintf(ptr, "%s", form("%s%s%s", f_prefix,
|
||||
intToAlpha(f_values.top(), f_case), f_postfix));
|
||||
else
|
||||
*ptr = 0;
|
||||
|
@ -481,13 +487,14 @@ autoNumberRoman::ArabicToRoman(int x)
|
|||
const char* romanCardinal = romanCardinals[j][buf[i]-'1'];
|
||||
char precise_romanCardinal[8];
|
||||
|
||||
int k;
|
||||
if (f_case == UPPER) {
|
||||
for (int k=0; romanCardinal[k]; k++)
|
||||
for (k=0; romanCardinal[k]; k++)
|
||||
precise_romanCardinal[k] = romanCardinal[k];
|
||||
precise_romanCardinal[k] = 0;
|
||||
}
|
||||
else {
|
||||
for (int k=0; romanCardinal[k]; k++)
|
||||
for (k=0; romanCardinal[k]; k++)
|
||||
precise_romanCardinal[k] = tolower(romanCardinal[k]);
|
||||
precise_romanCardinal[k] = 0;
|
||||
}
|
||||
|
|
|
@ -284,7 +284,8 @@ autoNumberFP::defineAutoNumber(const char* nm, const FeatureValue* f)
|
|||
|
||||
const char* gi = 0;
|
||||
autoNumberListT* anList = 0;
|
||||
for (int i=0; i<controlList -> length(); i++ ) {
|
||||
int i;
|
||||
for (i=0; i<controlList -> length(); i++ ) {
|
||||
|
||||
gi = stringToCharPtr((*controlList)[i]);
|
||||
key = new CC_String(gi);
|
||||
|
@ -353,11 +354,11 @@ autoNumberFP::accept(const char* name, const Expression* expr)
|
|||
{
|
||||
FeatureValue* fv = 0;
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
fv = expr -> evaluate();
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,13 @@ DONES = \
|
|||
|
||||
EXTRALIBRARYDEPS = $(DONES)
|
||||
|
||||
XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir
|
||||
#undef TopLevelProject
|
||||
#define TopLevelProject DtInfo
|
||||
IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \
|
||||
-DProjectTmplFile='<DtInfo.tmpl>' \
|
||||
-DProjectRulesFile='<DtInfo.rules>'
|
||||
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
ForceSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
|
@ -201,8 +208,8 @@ UTILITY_OBJS = \
|
|||
utility/filter.o utility/mmdb_exception.o \
|
||||
utility/randomize.o \
|
||||
utility/streambuf.o utility/charbuf.o utility/filebuf.o \
|
||||
utility/strstream.o utility/iostream.o utility/fstream.o \
|
||||
utility/stream.o utility/ios.o
|
||||
utility/stringstream.o utility/iostream.o utility/fstream.o \
|
||||
utility/stream.o utility/string.o utility/ios.o
|
||||
|
||||
|
||||
OBJS = $(API_OBJS) $(BTREE_OBJS) \
|
||||
|
@ -221,4 +228,8 @@ DYNAMIC =
|
|||
|
||||
#include <Library.tmpl>
|
||||
|
||||
XCOMM Variables to switch on debug mode temporarily
|
||||
XCOMM CDEBUGFLAGS = -g -DDEBUG
|
||||
XCOMM CXXDEBUGFLAGS = -g -DDEBUG
|
||||
|
||||
DependTarget()
|
||||
|
|
|
@ -38,6 +38,7 @@ Attribute::~Attribute()
|
|||
delete f_value ;
|
||||
}
|
||||
|
||||
bool
|
||||
Attribute::operator==(const Attribute &attr) const
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
~Attribute();
|
||||
|
||||
const Symbol &name() const { return f_name; }
|
||||
operator==(const Attribute &) const ;
|
||||
bool operator==(const Attribute &) const ;
|
||||
|
||||
const char *value() const { return f_value ; }
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
#ifndef _BitVector_h
|
||||
#define _BitVector_h 1
|
||||
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
using namespace std;
|
||||
|
||||
#ifndef CDE_NEXT
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
#ifndef _debug_h
|
||||
#define _debug_h 1
|
||||
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ON_DEBUG(stmt) stmt
|
||||
|
|
|
@ -52,7 +52,7 @@ DocParser::DocParser(Resolver &r)
|
|||
f_buffer(new char[DATA_BUF_SIZ]),
|
||||
f_output(f_buffer, DATA_BUF_SIZ)
|
||||
#else
|
||||
f_streambuf(new strstreambuf(DATA_BUF_SIZ)),
|
||||
f_streambuf(new stringbuf()),
|
||||
f_output(f_streambuf)
|
||||
#endif
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ DocParser::rawParse(istream &input)
|
|||
Symbol name(gElemSymTab->intern(terminate(f_output).str()));
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char *)f_streambuf->str().c_str();
|
||||
|
||||
/*
|
||||
MESSAGE(cerr, "StartTag case:");
|
||||
|
@ -102,9 +102,8 @@ debug(cerr, data);
|
|||
*/
|
||||
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
f_streambuf->freeze(0);
|
||||
Symbol name(gElemSymTab->intern(data));
|
||||
#endif
|
||||
process(input, f_output, name, 1, 1);
|
||||
|
@ -161,7 +160,7 @@ DocParser::process(istream &input, ostream &output,
|
|||
|
||||
int ignore = 0 ;
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
// process whatever comes right after start tag
|
||||
TagType tt = read_tag(input, output);
|
||||
|
@ -194,15 +193,14 @@ DocParser::process(istream &input, ostream &output,
|
|||
|
||||
process(input, output, name, child++, child_relative_sibling_number);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char *)f_streambuf->str().c_str();
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
Symbol name(gElemSymTab->intern(data));
|
||||
update_last_seen_child_name(last_seen_child_name,
|
||||
child_relative_sibling_number, name);
|
||||
|
||||
f_streambuf->freeze(0);
|
||||
process(input, output, name,
|
||||
child++, child_relative_sibling_number);
|
||||
#endif
|
||||
|
@ -216,12 +214,11 @@ DocParser::process(istream &input, ostream &output,
|
|||
char *data = terminate(f_output).str();
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char*)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
f_streambuf->freeze(0);
|
||||
#endif
|
||||
cerr << "EndTag: " << data << endl;
|
||||
assert(gElemSymTab->intern(data) == name);
|
||||
|
@ -246,7 +243,8 @@ DocParser::process(istream &input, ostream &output,
|
|||
!defined(_IBMR2) && \
|
||||
!defined(__uxp__) && \
|
||||
!defined(USL) && \
|
||||
!defined(linux)
|
||||
!defined(linux) && \
|
||||
!defined(CSRG_BASED)
|
||||
volatile
|
||||
#endif
|
||||
AttributeList *attrs = 0;
|
||||
|
@ -255,12 +253,13 @@ DocParser::process(istream &input, ostream &output,
|
|||
!defined(_IBMR2) && \
|
||||
!defined(__uxp__) && \
|
||||
!defined(USL) && \
|
||||
!defined(linux)
|
||||
!defined(linux) && \
|
||||
!defined(CSRG_BASED)
|
||||
volatile
|
||||
#endif
|
||||
AttributeList *olias_attrs = 0;
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
process_attributes(input, output, attrs, olias_attrs);
|
||||
|
||||
|
@ -278,7 +277,7 @@ DocParser::process(istream &input, ostream &output,
|
|||
f_ignoring_element = ignore ;
|
||||
}
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
/*
|
||||
delete attrs ;
|
||||
|
@ -318,16 +317,15 @@ DocParser::process(istream &input, ostream &output,
|
|||
f_resolver.data(string, size);
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *string = f_streambuf->str();
|
||||
char *string = (char *)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
string[f_streambuf->pcount()] = 0;
|
||||
int size = f_streambuf->pcount() ;
|
||||
string[f_streambuf->str().size()] = 0;
|
||||
int size = f_streambuf->str().size() ;
|
||||
#else
|
||||
int size = f_streambuf->pcount() - 1 ;
|
||||
#endif
|
||||
f_resolver.data(string, size);
|
||||
f_streambuf->freeze(0); // unfreeze buffer frozen by str() call
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -347,12 +345,11 @@ DocParser::process(istream &input, ostream &output,
|
|||
*(data + f_output.pcount()) = 0;
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char *)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount ()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
f_streambuf->freeze(0);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -391,16 +388,15 @@ debug(cerr, f_streambuf->pcount ());
|
|||
f_resolver.data(string, size);
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *string = f_streambuf->str();
|
||||
char *string = (char *)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
string[f_streambuf->pcount()] = 0;
|
||||
int size = f_streambuf->pcount() ;
|
||||
string[f_streambuf->str().size()] = 0;
|
||||
int size = f_streambuf->str().size() ;
|
||||
#else
|
||||
int size = f_streambuf->pcount() - 1 ;
|
||||
#endif
|
||||
f_resolver.data(string, size);
|
||||
f_streambuf->freeze(0); // unfreeze buffer frozen by str() call
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -411,12 +407,11 @@ debug(cerr, f_streambuf->pcount ());
|
|||
char *data = terminate(f_output).str();
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char*)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount ()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
f_streambuf->freeze(0);
|
||||
#endif
|
||||
cerr << "EndTag: " << data << endl;
|
||||
assert(gElemSymTab->intern(data) == name);
|
||||
|
@ -430,7 +425,7 @@ debug(cerr, f_streambuf->pcount ());
|
|||
if (ignore)
|
||||
f_ignoring_element = 0;
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
rethrow;
|
||||
}
|
||||
|
@ -454,7 +449,7 @@ DocParser::process_attributes(istream &input, ostream &output,
|
|||
|
||||
char *theData = 0;
|
||||
|
||||
try {
|
||||
mtry {
|
||||
while ((tt = read_tag(input,output)) != NoTag)
|
||||
{
|
||||
switch (tt)
|
||||
|
@ -463,8 +458,8 @@ DocParser::process_attributes(istream &input, ostream &output,
|
|||
{
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
theData = f_streambuf->str ();
|
||||
theData[f_streambuf->pcount()] = 0;
|
||||
theData = (char *)f_streambuf->str().c_str();
|
||||
theData[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
if (!attrs)
|
||||
attrs = new AttributeList ;
|
||||
|
@ -495,8 +490,8 @@ DocParser::process_attributes(istream &input, ostream &output,
|
|||
case OliasAttribute:
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
theData = f_streambuf->str ();
|
||||
theData[f_streambuf->pcount()] = 0;
|
||||
theData = (char *)f_streambuf->str().c_str();
|
||||
theData[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
// mirrors attribute
|
||||
if (!olias_attrs)
|
||||
|
@ -525,7 +520,7 @@ DocParser::process_attributes(istream &input, ostream &output,
|
|||
}
|
||||
}
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
delete newAttribute;
|
||||
|
||||
|
@ -568,12 +563,11 @@ DocParser::process_attribute(istream &input, ostream &output,
|
|||
*(data + f_output.pcount()) = 0;
|
||||
f_output.rdbuf()->freeze(0);
|
||||
#else
|
||||
char *data = f_streambuf->str();
|
||||
char *data = (char *)f_streambuf->str().c_str();
|
||||
//#ifdef _IBMR2
|
||||
#if !defined(SC3) && !defined(__osf__)
|
||||
data[f_streambuf->pcount ()] = 0;
|
||||
data[f_streambuf->str().size()] = 0;
|
||||
#endif
|
||||
f_streambuf->freeze(0);
|
||||
#endif
|
||||
Attribute *attr = new Attribute(name, strdup(data));
|
||||
|
||||
|
|
|
@ -24,8 +24,9 @@
|
|||
/* Copyright (c) 1995 FUJITSU LIMITED */
|
||||
/* All Rights Reserved */
|
||||
|
||||
#include <iostream.h>
|
||||
#include <strstream.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
#include "SymTab.h"
|
||||
#include "Exceptions.hh"
|
||||
|
@ -84,7 +85,7 @@ private:
|
|||
char* const f_buffer;
|
||||
ostrstream f_output;
|
||||
#else
|
||||
strstreambuf *f_streambuf ;
|
||||
stringbuf *f_streambuf;
|
||||
ostream f_output;
|
||||
#endif
|
||||
Resolver &f_resolver;
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
// $TOG: Element.C /main/5 1998/04/17 11:48:25 mgreess $
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include <stdlib.h>
|
||||
#include "StyleSheetExceptions.h"
|
||||
#include "Element.h"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "VariableTable.h"
|
||||
#include "Renderer.h"
|
||||
#include "Debug.h"
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "HardCopy/autoNumberFP.h"
|
||||
|
||||
|
@ -141,20 +141,20 @@ BinaryOperatorNode::evaluate() const
|
|||
{
|
||||
// calculate children trees and then have feature value do the operation
|
||||
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
|
||||
volatile
|
||||
#endif
|
||||
FeatureValue *left = 0;
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
|
||||
volatile
|
||||
#endif
|
||||
FeatureValue *right = 0;
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux)
|
||||
#if !defined(SC3) && !defined(_IBMR2) && !defined(__uxp__) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
|
||||
volatile
|
||||
#endif
|
||||
FeatureValue *result = 0;
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
left = f_left->evaluate();
|
||||
right = f_right->evaluate();
|
||||
|
@ -176,7 +176,7 @@ BinaryOperatorNode::evaluate() const
|
|||
}
|
||||
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
delete left ;
|
||||
delete right ;
|
||||
|
@ -219,11 +219,11 @@ VariableNode::evaluate() const
|
|||
// etc.
|
||||
FeatureValue *return_variable = 0;
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
return_variable = variable_value->evaluate() ;
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
delete return_variable;
|
||||
delete variable_value ;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#ifndef _Feature_h
|
||||
#define _Feature_h
|
||||
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
|
||||
#ifndef CDE_NEXT
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include "StyleSheet/StyleSheetExceptions.h"
|
||||
#include "utility/const.h"
|
||||
#include "utility/funcs.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
featureDefDictionary* g_FeatureDefDictionary = 0;
|
||||
|
||||
|
@ -314,34 +315,34 @@ MESSAGE(cerr, "");
|
|||
}
|
||||
|
||||
FeatureValue * fv = 0;
|
||||
try {
|
||||
mtry {
|
||||
fv = f -> evaluate();
|
||||
}
|
||||
catch (undefinedAttributeException&, e) {
|
||||
mcatch (undefinedAttributeException&, e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
catch (undefinedVariableException&, e) {
|
||||
mcatch (undefinedVariableException&, e) {
|
||||
report_error_location();
|
||||
cerr << "Undefined variable error.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
catch (badCastException&, e) {
|
||||
mcatch (badCastException&, e) {
|
||||
report_error_location();
|
||||
cerr << "Evaluating expression error.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
catch (badEvaluationException&, e) {
|
||||
mcatch (badEvaluationException&, e) {
|
||||
report_error_location();
|
||||
cerr << "Evaluating expression error.\n";
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
catch_any() {
|
||||
mcatch_any() {
|
||||
//report_error_location();
|
||||
//cerr << "There might be an error in the expression.\n";
|
||||
return true;
|
||||
|
|
|
@ -75,16 +75,16 @@ FeatureSet::evaluate(FeatureSet *result_set) const
|
|||
while(++next)
|
||||
{
|
||||
FeatureValue *value ;
|
||||
try
|
||||
mtry
|
||||
{
|
||||
value = next.key()->evaluate();
|
||||
result_set->append(new Feature(next.key()->name(),
|
||||
value));
|
||||
}
|
||||
#ifdef UXPDS
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
#else
|
||||
catch_noarg(badEvaluationException)
|
||||
mcatch_noarg(badEvaluationException)
|
||||
#endif
|
||||
{
|
||||
/* do nothing...we just ignore any that will not evaluate */
|
||||
|
@ -143,7 +143,8 @@ FeatureSet::print(ostream &o) const
|
|||
// cast to non-const to get iterator
|
||||
CC_TPtrSlistIterator<Feature> next(*(CC_TPtrSlist<Feature>*)this);
|
||||
|
||||
for (int i = 0 ; i < f_print_indent_level; i++)
|
||||
int i;
|
||||
for (i = 0 ; i < f_print_indent_level; i++)
|
||||
o << " " ;
|
||||
|
||||
o << "{" << endl;
|
||||
|
|
|
@ -522,7 +522,8 @@ FeatureValueString::operator+(const FeatureValue& x) const
|
|||
|
||||
char* newString = new char[len1 + len2 + 1];
|
||||
|
||||
for ( int i=0; i<len1; i++ )
|
||||
int i;
|
||||
for ( i=0; i<len1; i++ )
|
||||
newString[i] = str1[i];
|
||||
|
||||
for ( i=0; i<len2; i++ )
|
||||
|
@ -560,14 +561,14 @@ FeatureValueString::operator+(const FeatureValueExpression& expr) const
|
|||
{
|
||||
FeatureValue *x = 0;
|
||||
FeatureValue *y = 0;
|
||||
try
|
||||
mtry
|
||||
{
|
||||
x = expr.evaluate();
|
||||
y = operator+(*x);
|
||||
delete x;
|
||||
return y;
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
delete x;
|
||||
rethrow;
|
||||
|
@ -2343,13 +2344,13 @@ FeatureValueArray::FeatureValueArray(const FeatureValueArray& x) :
|
|||
f_name(strdup(x.f_name)), FeatureValue(array),
|
||||
pointer_vector<FeatureValue>(x.length(), 0)
|
||||
{
|
||||
try
|
||||
mtry
|
||||
{
|
||||
for ( int i=0; i<length(); i++ )
|
||||
(*this)[i] = x[i] -> clone();
|
||||
return;
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
for ( int i=0; i<length(); i++ )
|
||||
delete (*this)[i];
|
||||
|
@ -2371,14 +2372,14 @@ FeatureValueArray::evaluate() const
|
|||
{
|
||||
FeatureValueArray *result = new FeatureValueArray(f_name, length());
|
||||
|
||||
try
|
||||
mtry
|
||||
{
|
||||
for ( int i=0; i<length(); i++ ) {
|
||||
(*result)[i] = (*this)[i] -> evaluate();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
delete result;
|
||||
rethrow;
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
// $XConsortium: PQTest.cc /main/3 1996/06/11 17:07:26 cde-hal $
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include "SymTab.h"
|
||||
#include "PathQualifier.h"
|
||||
#include "Element.h"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "dti_cc/cc_hdict.h"
|
||||
#endif
|
||||
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
#include "Types.h"
|
||||
#include "SymTab.h"
|
||||
#include "SSPath.h"
|
||||
|
|
|
@ -64,7 +64,7 @@ unsigned int PathTerm::operator ==(const PathTerm&)
|
|||
|
||||
ostream& operator <<(ostream& out, PathTerm& pt)
|
||||
{
|
||||
out << pt.symbol() << " (" << int(pt.f_PQExpr) << ") ";
|
||||
out << pt.symbol() << " (" << size_t(pt.f_PQExpr) << ") ";
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,21 +27,6 @@
|
|||
#include "Exceptions.hh"
|
||||
#include "SymTab.h"
|
||||
|
||||
#if defined(linux)
|
||||
#define CASTEXCEPT (Exception*)
|
||||
#define CASTBCEXCEPT (badCastException*)
|
||||
#define CASTBEEXCEPT (badEvaluationException*)
|
||||
#define CASTDPEXCEPT (docParserException*)
|
||||
#define CASTDPUCEXCEPT (docParserUnexpectedCharacter*)
|
||||
#define CASTDPUTEXCEPT (docParserUnexpectedTag*)
|
||||
#define CASTDPUDEXCEPT (docParserUnexpectedData*)
|
||||
#define CASTDPUEEXCEPT (docParserUnexpectedEof*)
|
||||
#define CASTSSEXCEPT (StyleSheetException*)
|
||||
#define CASTSSSEEXCEPT (StyleSheetSyntaxError*)
|
||||
#define CASTUAEXCEPT (undefinedAttributeException*)
|
||||
#define CASTUTEXCEPT (unknownTagException*)
|
||||
#define CASTUVEXCEPT (undefinedVariableException*)
|
||||
#else
|
||||
#define CASTEXCEPT
|
||||
#define CASTBCEXCEPT
|
||||
#define CASTBEEXCEPT
|
||||
|
@ -55,7 +40,6 @@
|
|||
#define CASTUAEXCEPT
|
||||
#define CASTUTEXCEPT
|
||||
#define CASTUVEXCEPT
|
||||
#endif
|
||||
|
||||
class StyleSheetException : public Exception
|
||||
{
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include "dti_cc/CC_String.h"
|
||||
#include "dti_cc/cc_hdict.h"
|
||||
//#include "StyleSheet/cde_next.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
#include "Types.h"
|
||||
|
|
|
@ -27,8 +27,9 @@ static char defParsersccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
|
|||
#define defParserBYACC 1
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stream.h>
|
||||
#include <iostream.h>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include "Debug.h"
|
||||
#include "FeatureDefDictionary.h"
|
||||
|
||||
|
@ -269,14 +270,16 @@ defParserloop:
|
|||
goto defParserreduce;
|
||||
}
|
||||
if (defParsererrflag) goto defParserinrecovery;
|
||||
#if 0 // Disable for now
|
||||
// Disable for now
|
||||
#if 0
|
||||
#ifdef lint
|
||||
goto defParsernewerror;
|
||||
#endif
|
||||
defParsernewerror:
|
||||
#endif /* 0 */
|
||||
defParsererror("syntax error");
|
||||
#if 0 // Disable for now
|
||||
defParsererror((char*)"syntax error");
|
||||
// Disable for now
|
||||
#if 0
|
||||
#ifdef lint
|
||||
goto defParsererrlab;
|
||||
#endif
|
||||
|
@ -516,7 +519,7 @@ to state %d\n", *defParserssp, defParserstate);
|
|||
*++defParservsp = defParserval;
|
||||
goto defParserloop;
|
||||
defParseroverflow:
|
||||
defParsererror("yacc stack overflow");
|
||||
defParsererror((char*)"yacc stack overflow");
|
||||
defParserabort:
|
||||
return (1);
|
||||
defParseraccept:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
%{
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
#include <iostream.h>
|
||||
#include "Debug.h"
|
||||
#include "FeatureDefDictionary.h"
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
|
||||
|
@ -196,7 +196,8 @@ typedef struct defParser_buffer_state *defParser_BUFFER_STATE;
|
|||
#include "FeatureDefDictionary.h"
|
||||
#include "defParser.tab.h"
|
||||
#include "Debug.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
extern istream *g_defParserin;
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
#include "FeatureDefDictionary.h"
|
||||
#include "defParser.tab.h"
|
||||
#include "Debug.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
extern istream *g_yyin;
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
#include "StyleSheet.h"
|
||||
#include "StyleSheetExceptions.h"
|
||||
#include "VariableTable.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
Renderer *gRenderer = 0;
|
||||
class TestRenderer : public Renderer
|
||||
|
|
|
@ -27,8 +27,9 @@ static char stylesccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
|
|||
#define styleBYACC 1
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stream.h>
|
||||
#include <iostream.h>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include <assert.h>
|
||||
#include "StyleSheetExceptions.h"
|
||||
#include "VariableTable.h"
|
||||
|
@ -533,7 +534,7 @@ styleloop:
|
|||
#endif
|
||||
stylenewerror:
|
||||
#endif /* if 0 */
|
||||
styleerror("syntax error");
|
||||
styleerror((char*)"syntax error");
|
||||
#if 0 /* remove if needed */
|
||||
#ifdef lint
|
||||
goto styleerrlab;
|
||||
|
@ -1353,7 +1354,7 @@ to state %d\n", *stylessp, stylestate);
|
|||
*++stylevsp = styleval;
|
||||
goto styleloop;
|
||||
styleoverflow:
|
||||
styleerror("yacc stack overflow");
|
||||
styleerror((char*)"yacc stack overflow");
|
||||
styleabort:
|
||||
return (1);
|
||||
styleaccept:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
%{
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
#include <iostream.h>
|
||||
#include <assert.h>
|
||||
#include "StyleSheetExceptions.h"
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
|
||||
|
@ -228,7 +228,8 @@ typedef struct style_buffer_state *style_BUFFER_STATE;
|
|||
#include "StyleSheetExceptions.h"
|
||||
#include "style.tab.h"
|
||||
#include "Debug.h"
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
istream *g_stylein = 0;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -102,5 +102,6 @@ base::base(object_dict* obj_dict,
|
|||
|
||||
base::~base()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,10 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef C_API
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
#endif
|
||||
#include "api/info_base.h"
|
||||
#include "compression/abs_agent.h"
|
||||
|
||||
|
@ -74,21 +78,22 @@ debug(cerr, base_ds);
|
|||
*info_base_locale = 0;
|
||||
|
||||
char* nm ;
|
||||
int i;
|
||||
|
||||
//////////////////////
|
||||
// sets
|
||||
//////////////////////
|
||||
info_base_set_ptrs = new cset_handlerPtr[num_cset_ptrs];
|
||||
|
||||
for ( int i=0; i<num_cset_ptrs; i++ ) {
|
||||
for ( i=0; i<num_cset_ptrs; i++ ) {
|
||||
|
||||
nm = form("%s.%s", base_nm, info_base_set_names[i]);
|
||||
|
||||
try {
|
||||
mtry {
|
||||
info_base_set_ptrs[i] = (cset_handler*)
|
||||
(f_obj_dict -> get_handler(nm));
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
info_base_set_ptrs[i] = 0;
|
||||
}
|
||||
|
@ -104,11 +109,11 @@ debug(cerr, base_ds);
|
|||
|
||||
nm = form("%s.%s", base_nm, info_base_list_names[i]);
|
||||
|
||||
try {
|
||||
mtry {
|
||||
info_base_list_ptrs[i] = (dl_list_handler*)
|
||||
obj_dict.get_handler(nm);
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
info_base_list_ptrs[i] = 0;
|
||||
}
|
||||
|
@ -195,23 +200,23 @@ int info_base::num_of_docs()
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
iterator::iterator( handler* x, c_code_t y) :
|
||||
Iterator::Iterator( handler* x, c_code_t y) :
|
||||
collection_hd(x), instance_c_code(y), ind(0)
|
||||
{
|
||||
}
|
||||
|
||||
iterator::~iterator()
|
||||
Iterator::~Iterator()
|
||||
{
|
||||
}
|
||||
|
||||
iterator::operator void*()
|
||||
Iterator::operator void*()
|
||||
{
|
||||
return ( ind == 0 ) ? 0 : (void*)1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
iterator* info_base::first(char* col_nm, c_code_t code)
|
||||
Iterator* info_base::first(char* col_nm, c_code_t code)
|
||||
{
|
||||
handler* x = get_set(col_nm);
|
||||
|
||||
|
@ -233,7 +238,7 @@ iterator* info_base::first(char* col_nm, c_code_t code)
|
|||
throw(stringException("non page store no supported"));
|
||||
}
|
||||
|
||||
iterator* it = new iterator(x, code);
|
||||
Iterator* it = new Iterator(x, code);
|
||||
|
||||
it -> ind = s -> first_loc();
|
||||
|
||||
|
@ -244,7 +249,7 @@ iterator* info_base::first(char* col_nm, c_code_t code)
|
|||
return it;
|
||||
}
|
||||
|
||||
oid_t info_base::get_oid(const iterator& it)
|
||||
oid_t info_base::get_oid(const Iterator& it)
|
||||
{
|
||||
page_storage *s = (page_storage*)( it.collection_hd -> its_store() );
|
||||
|
||||
|
@ -256,7 +261,7 @@ oid_t info_base::get_oid(const iterator& it)
|
|||
return r -> my_oid();
|
||||
}
|
||||
|
||||
void info_base::next(iterator& it)
|
||||
void info_base::next(Iterator& it)
|
||||
{
|
||||
page_storage *s = (page_storage*)( it.collection_hd -> its_store());
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@
|
|||
#include "object/cset.h"
|
||||
#include "object/dl_list.h"
|
||||
|
||||
class iterator
|
||||
class Iterator
|
||||
{
|
||||
public:
|
||||
iterator( handler*, c_code_t );
|
||||
~iterator();
|
||||
Iterator( handler*, c_code_t );
|
||||
~Iterator();
|
||||
|
||||
operator void*();
|
||||
|
||||
|
@ -106,9 +106,9 @@ public:
|
|||
mm_version& data_version() { return f_v; };
|
||||
|
||||
// iterate over all instances with 'c_code' in a set or a list
|
||||
iterator* first(char* col_nm, c_code_t c_code);
|
||||
oid_t get_oid(const iterator& ind);
|
||||
void next(iterator&);
|
||||
Iterator* first(char* col_nm, c_code_t c_code);
|
||||
oid_t get_oid(const Iterator& ind);
|
||||
void next(Iterator&);
|
||||
|
||||
#ifdef C_API
|
||||
// an integer id within the infolib
|
||||
|
|
|
@ -317,7 +317,7 @@ debug(cerr, base_name);
|
|||
|
||||
//fprintf(stderr, "try to init %s\n", base_name);
|
||||
|
||||
try {
|
||||
mtry {
|
||||
f_obj_dict -> init_a_base((char*)base_path, (char*)base_name);
|
||||
|
||||
x = new info_base(*f_obj_dict, set_nm_list, list_nm_list,
|
||||
|
@ -328,7 +328,7 @@ debug(cerr, base_name);
|
|||
info_base_list.insert_as_tail(new dlist_void_ptr_cell(x));
|
||||
}
|
||||
|
||||
catch (mmdbException &,e)
|
||||
mcatch (mmdbException &,e)
|
||||
{
|
||||
//fprintf(stderr, "in catch block\n");
|
||||
return 0;
|
||||
|
@ -445,7 +445,8 @@ info_lib::define_info_base( char* base_name, char* base_desc,
|
|||
/*************************************/
|
||||
char* lib_nm = form("%s/%s", info_lib_path, MAP_FILE_8_3);
|
||||
|
||||
fstream nm_out(lib_nm, ios::app, open_file_prot());
|
||||
fstream nm_out(lib_nm, ios::out | ios::app);
|
||||
// fstream nm_out(lib_nm, ios::app, open_file_prot());
|
||||
|
||||
if ( !nm_out ) {
|
||||
MESSAGE(cerr, form("can't open %s/%s for append",
|
||||
|
@ -454,7 +455,7 @@ info_lib::define_info_base( char* base_name, char* base_desc,
|
|||
throw(streamException(nm_out.rdstate()));
|
||||
}
|
||||
|
||||
if ( bytes(nm_out) == 0 ) {
|
||||
if ( bytes(lib_nm) == 0 ) {
|
||||
char* lib_entry = form("%s\t%s\n", info_lib_name, unique_id());
|
||||
|
||||
if ( !(nm_out << lib_entry) ) {
|
||||
|
@ -589,7 +590,7 @@ info_lib::getInfobaseByComponent(const char *locator_string, enum TestSelector s
|
|||
if (ib==0)
|
||||
throw(stringException("null info_base ptr"));
|
||||
|
||||
try { // since an infobase may not have any graphics, we catch
|
||||
mtry { // since an infobase may not have any graphics, we catch
|
||||
// any exceptions there and try next infobase.
|
||||
|
||||
switch (sel) {
|
||||
|
@ -615,7 +616,7 @@ info_lib::getInfobaseByComponent(const char *locator_string, enum TestSelector s
|
|||
}
|
||||
}
|
||||
|
||||
catch (mmdbException &,e)
|
||||
mcatch (mmdbException &,e)
|
||||
{
|
||||
} end_try;
|
||||
|
||||
|
@ -630,7 +631,8 @@ info_base**
|
|||
info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSelector sel)
|
||||
{
|
||||
info_base** ibs = new info_basePtr[count];
|
||||
for ( int i=0; i<count; ibs[i++] = 0 );
|
||||
int i;
|
||||
for ( i=0; i<count; ibs[i++] = 0 );
|
||||
|
||||
info_base* ib = 0;
|
||||
|
||||
|
@ -645,7 +647,7 @@ info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSe
|
|||
|
||||
for ( i=0; i<count; i++ ) {
|
||||
|
||||
try {
|
||||
mtry {
|
||||
|
||||
if ( locator_strings[i] && ibs[i] == 0 ) {
|
||||
switch (sel) {
|
||||
|
@ -674,7 +676,7 @@ info_lib::getInfobasesByComponent(char **locator_strings, int count, enum TestSe
|
|||
}
|
||||
}
|
||||
|
||||
catch (mmdbException &,e)
|
||||
mcatch (mmdbException &,e)
|
||||
{
|
||||
} end_try;
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "dstr/dlist_void_ptr_cell.h"
|
||||
#include "api/info_base.h"
|
||||
#include "utility/funcs.h"
|
||||
#include "schema/object_dict.h"
|
||||
|
||||
/*************************************/
|
||||
// The info_lib class
|
||||
|
|
|
@ -288,8 +288,8 @@ void smart_ptr::update_oid(int i, const oid_t& x)
|
|||
handler* z = get_handler(i, OID_CODE);
|
||||
oid_handler* y = (oid_handler*)z;
|
||||
|
||||
sprintf(buf, "%d.%d\n", x.ccode(), x.icode());
|
||||
istrstream in(buf, 64);
|
||||
sprintf(buf, "%d.%d\n", x.ccode(), (int)x.icode());
|
||||
istringstream in(buf);
|
||||
|
||||
(*y) -> asciiIn(in);
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
#define _utility_h 1
|
||||
|
||||
#ifdef C_API
|
||||
#include "utility/c_strstream.h"
|
||||
#include "utility/c_stringstream.h"
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -289,7 +289,7 @@ bt_fast(t, key, data, exactp)
|
|||
const DBT *key, *data;
|
||||
int *exactp;
|
||||
{
|
||||
EPG e;
|
||||
static EPG e;
|
||||
PAGE *h;
|
||||
size_t nbytes;
|
||||
int cmp;
|
||||
|
|
|
@ -60,8 +60,12 @@
|
|||
#define _CDEFS_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#ifndef __BEGIN_DECLS
|
||||
#define __BEGIN_DECLS extern "C" {
|
||||
#endif
|
||||
#ifndef __END_DECLS
|
||||
#define __END_DECLS };
|
||||
#endif
|
||||
#else
|
||||
#define __BEGIN_DECLS
|
||||
#define __END_DECLS
|
||||
|
@ -79,7 +83,9 @@
|
|||
#undef __P
|
||||
#endif
|
||||
#define __P(protos) protos /* full-blown ANSI C */
|
||||
#ifndef __CONCAT
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#endif
|
||||
#define __STRING(x) #x
|
||||
|
||||
#else /* !(__STDC__ || __cplusplus) */
|
||||
|
@ -114,7 +120,9 @@
|
|||
*/
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#define __dead __volatile
|
||||
#ifndef __pure
|
||||
#define __pure __const
|
||||
#endif
|
||||
#else
|
||||
#define __dead
|
||||
#define __pure
|
||||
|
|
|
@ -111,13 +111,13 @@ bcopy(src0, dst0, length)
|
|||
/*
|
||||
* Copy forward.
|
||||
*/
|
||||
t = (int)src; /* only need low bits */
|
||||
if ((t | (int)dst) & wmask) {
|
||||
t = (size_t)src; /* only need low bits */
|
||||
if ((t | (size_t)dst) & wmask) {
|
||||
/*
|
||||
* Try to align operands. This cannot be done
|
||||
* unless the low bits match.
|
||||
*/
|
||||
if ((t ^ (int)dst) & wmask || length < wsize)
|
||||
if ((t ^ (size_t)dst) & wmask || length < wsize)
|
||||
t = length;
|
||||
else
|
||||
t = wsize - (t & wmask);
|
||||
|
@ -139,9 +139,9 @@ bcopy(src0, dst0, length)
|
|||
*/
|
||||
src += length;
|
||||
dst += length;
|
||||
t = (int)src;
|
||||
if ((t | (int)dst) & wmask) {
|
||||
if ((t ^ (int)dst) & wmask || length <= wsize)
|
||||
t = (size_t)src;
|
||||
if ((t | (size_t)dst) & wmask) {
|
||||
if ((t ^ (size_t)dst) & wmask || length <= wsize)
|
||||
t = length;
|
||||
else
|
||||
t &= wmask;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "cdefs.h"
|
||||
|
||||
#include <compat.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stdarg.h>
|
||||
|
@ -52,7 +53,7 @@ snprintf(str, n, fmt, va_alist)
|
|||
va_start(ap);
|
||||
#endif
|
||||
#ifdef VSPRINTF_CHARSTAR
|
||||
rp = vsprintf(str, fmt, ap);
|
||||
rp = (char*)(size_t)vsprintf(str, fmt, ap);
|
||||
va_end(ap);
|
||||
return (strlen(rp));
|
||||
#else
|
||||
|
@ -70,7 +71,7 @@ vsnprintf(str, n, fmt, ap)
|
|||
va_list ap;
|
||||
{
|
||||
#ifdef VSPRINTF_CHARSTAR
|
||||
return (strlen(vsprintf(str, fmt, ap)));
|
||||
return (strlen((char*)(size_t)vsprintf(str, fmt, ap)));
|
||||
#else
|
||||
return (vsprintf(str, fmt, ap));
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -400,11 +400,12 @@ io_status huff::cdrOut(buffer& buf)
|
|||
//MESSAGE(cerr, "huff::cdrOut");
|
||||
//debug(cerr, my_oid());
|
||||
static buffer v_out_buf(LBUFSIZ);
|
||||
int i;
|
||||
|
||||
if ( cts > 0 ) {
|
||||
//MESSAGE(cerr, "huff::cdrOut: dict out");
|
||||
int sz = sizeof(int);
|
||||
for ( int i=0; i<cts; i++ ) {
|
||||
for ( i=0; i<cts; i++ ) {
|
||||
sz += ( e_units[i] -> word -> size() +
|
||||
sizeof(unsigned int) +
|
||||
sizeof(char)
|
||||
|
|
|
@ -43,9 +43,13 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(__uxp__) && !defined(USL)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* use prototypes in function declarations */
|
||||
#define ps_USE_PROTOS
|
||||
|
|
|
@ -43,9 +43,13 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(__uxp__) && !defined(USL)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* use prototypes in function declarations */
|
||||
#define sgml_USE_PROTOS
|
||||
|
|
|
@ -360,9 +360,9 @@ Boolean trie::travers_to(char* str, int len,
|
|||
|
||||
|
||||
node = root;
|
||||
int j;
|
||||
int i, j;
|
||||
|
||||
for ( int i=0; i<len; i++ ) {
|
||||
for ( i=0; i<len; i++ ) {
|
||||
j = str[i];
|
||||
|
||||
//debug(cerr, str[i]);
|
||||
|
|
|
@ -61,6 +61,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
|||
// code for testing. I know it is slow.
|
||||
////////////////////////////////////////
|
||||
|
||||
int ret;
|
||||
fstream out(UNCOMPRESSED, ios::out|ios::trunc);
|
||||
|
||||
if ( !out )
|
||||
|
@ -71,14 +72,14 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
|||
|
||||
out.close();
|
||||
|
||||
system(form("gzip -c %s > %s", UNCOMPRESSED, COMPRESSED));
|
||||
ret = system(form("gzip -c %s > %s", (char*)UNCOMPRESSED,(char*)COMPRESSED));
|
||||
|
||||
fstream in(COMPRESSED, ios::in);
|
||||
|
||||
if ( !in )
|
||||
throw(streamException(in.rdstate()));
|
||||
|
||||
int x = bytes(in);
|
||||
int x = bytes((char*)COMPRESSED);
|
||||
|
||||
compressed.expand_chunk(x);
|
||||
|
||||
|
@ -94,6 +95,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
|||
|
||||
void zip::decompress(buffer& compressed, buffer& uncompressed)
|
||||
{
|
||||
int ret;
|
||||
fstream out(COMPRESSED, ios::out|ios::trunc);
|
||||
|
||||
if ( !out )
|
||||
|
@ -104,14 +106,14 @@ void zip::decompress(buffer& compressed, buffer& uncompressed)
|
|||
|
||||
out.close();
|
||||
|
||||
system(form("gzip -cd %s > %s", COMPRESSED, UNCOMPRESSED));
|
||||
ret = system(form("gzip -cd %s > %s",(char*)COMPRESSED,(char*)UNCOMPRESSED));
|
||||
|
||||
fstream in(UNCOMPRESSED, ios::in);
|
||||
|
||||
if ( !in )
|
||||
throw(streamException(in.rdstate()));
|
||||
|
||||
int x = bytes(in);
|
||||
int x = bytes((char*)UNCOMPRESSED);
|
||||
|
||||
uncompressed.expand_chunk(x);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -315,7 +315,7 @@ void disk_hash::caching(disk_bucket& b, data_t& w, int slot_num)
|
|||
|
||||
if ( x ) {
|
||||
hash_vector -> insert(
|
||||
voidPtr(ind),
|
||||
(voidPtr)(size_t)ind,
|
||||
x -> slot_num(k, r, p, hash_vector -> count())
|
||||
);
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ void disk_hash::caching(disk_bucket& b, data_t& w, int slot_num)
|
|||
// others may be overwritten.
|
||||
////////////////////////////////////////
|
||||
hash_vector -> insert(
|
||||
voidPtr(slot_num),
|
||||
(voidPtr)(size_t)slot_num,
|
||||
w.slot_num(k, r, p, hash_vector -> count())
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
#ifdef C_API
|
||||
#include "utility/c_stream.h"
|
||||
#else
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
#ifdef C_API
|
||||
#include "utility/c_stream.h"
|
||||
#else
|
||||
#include <stream.h>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
token_stack::token_stack() : curr_token_start(0)
|
||||
|
|
|
@ -56,7 +56,7 @@ CC_TPtrDlist<T>::CC_TPtrDlist(const CC_TPtrDlist<T>&adlist)
|
|||
template <class T>
|
||||
void CC_TPtrDlist<T>::clear()
|
||||
{
|
||||
if ( !destructed ) {
|
||||
if ( !this->get_destructed() ) {
|
||||
CC_TPtrSlistIterator<T> iter(*this);
|
||||
if (++iter) {
|
||||
while (1) {
|
||||
|
@ -82,7 +82,7 @@ template <class T>
|
|||
void CC_TPtrDlist<T>::clearAndDestroy()
|
||||
{
|
||||
|
||||
destructed = TRUE;
|
||||
this->set_destructed(TRUE);
|
||||
CC_TPtrDlistIterator<T> iter(*this);
|
||||
if ( ++iter ) {
|
||||
while (1) {
|
||||
|
|
|
@ -41,23 +41,6 @@ CC_TPtrSlist<T>::CC_TPtrSlist(const CC_TPtrSlist<T>&slist)
|
|||
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------
|
||||
template<class T>
|
||||
T *CC_TPtrSlist<T>::at(size_t pos) const
|
||||
{
|
||||
|
||||
// Hack to get it passed to iter
|
||||
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
|
||||
for ( int i = 0; i <=pos; i++ ) {
|
||||
if ( !(++iter) ) {
|
||||
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
|
||||
}
|
||||
}
|
||||
|
||||
return( iter.key() );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
template<class T>
|
||||
T *CC_TPtrSlist<T>::removeAt(size_t pos) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#define __CC_Slist_h
|
||||
|
||||
#include "CC_Listbase.h"
|
||||
#include "cc_exceptions.h"
|
||||
|
||||
template <class T> class CC_TPtrSlist;
|
||||
template <class T> class CC_TPtrSlistIterator;
|
||||
|
@ -65,7 +66,7 @@ class CC_TPtrSlist : public CC_Listbase
|
|||
friend class CC_List_Iterator<T>;
|
||||
|
||||
protected:
|
||||
CC_Boolean destructed;
|
||||
CC_Boolean destructed;
|
||||
|
||||
// Inherit public members from CC_Listbase
|
||||
/*
|
||||
|
@ -97,9 +98,20 @@ public:
|
|||
void insert(T* element)
|
||||
{ CC_Listbase::append (new CC_Link<T> (element)); }
|
||||
|
||||
T* at(size_t pos) const; /* throw boundaryException
|
||||
T* at(size_t pos) const /* throw boundaryException
|
||||
* if list size is smaller than pos
|
||||
*/
|
||||
{
|
||||
// Hack to get it passed to iter
|
||||
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
|
||||
for ( int i = 0; i <=pos; i++ ) {
|
||||
if ( !(++iter) ) {
|
||||
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
|
||||
}
|
||||
}
|
||||
|
||||
return( iter.key() );
|
||||
}
|
||||
|
||||
T* removeAt(size_t pos); /* throw boundaryException
|
||||
* if list size is smaller than pos
|
||||
|
@ -146,7 +158,11 @@ public:
|
|||
|
||||
operator CC_Listbase *() { return(this); }
|
||||
|
||||
CC_Boolean get_destructed() const
|
||||
{ return (destructed); }
|
||||
|
||||
CC_Boolean set_destructed(CC_Boolean what)
|
||||
{ destructed = what; }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -23,54 +23,3 @@
|
|||
// $XConsortium: CC_Stack.C /main/4 1996/10/08 19:22:53 cde-hal $
|
||||
#include "CC_Stack.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
template <class T> Stack<T>::Stack ()
|
||||
{
|
||||
Items = new CC_TValSlist<T>();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <class T> Stack<T>::~Stack ()
|
||||
{
|
||||
delete Items;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <class T>
|
||||
void
|
||||
Stack<T>::push (const T newItem)
|
||||
{
|
||||
Items->append ( newItem );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
template <class T>
|
||||
T
|
||||
Stack<T>::pop () {
|
||||
CC_Link<T> *last_elem = (CC_Link<T> *)Items->removeLast();
|
||||
|
||||
if ( !last_elem ) {
|
||||
throw (Exception());
|
||||
}
|
||||
|
||||
T *ret = last_elem->f_element;
|
||||
delete last_elem;
|
||||
|
||||
T ret_value = *ret;
|
||||
delete ret;
|
||||
|
||||
return(ret_value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
template <class T>
|
||||
T&
|
||||
Stack<T>::top () const
|
||||
{
|
||||
CC_Link<T> *last_elem = (CC_Link<T> *)Items->last();
|
||||
if ( !last_elem ) {
|
||||
throw(Exception());
|
||||
}
|
||||
|
||||
return ( *last_elem->f_element );
|
||||
}
|
||||
|
|
|
@ -31,19 +31,55 @@ template <class T> class Stack: public Destructable
|
|||
{
|
||||
|
||||
public:
|
||||
Stack (); /* This is a value stack, ie an assignment operator
|
||||
* for T is assumed */
|
||||
/* This is a value stack, ie an assignment operator for T is assumed */
|
||||
Stack ()
|
||||
{
|
||||
Items = new CC_TValSlist<T>();
|
||||
}
|
||||
|
||||
~Stack ();
|
||||
~Stack ()
|
||||
{
|
||||
delete Items;
|
||||
}
|
||||
|
||||
public:
|
||||
T pop ();
|
||||
void push (const T);
|
||||
T& top () const;
|
||||
T pop ()
|
||||
{
|
||||
CC_Link<T> *last_elem = (CC_Link<T> *)Items->removeLast();
|
||||
|
||||
if ( !last_elem ) {
|
||||
throw (Exception());
|
||||
}
|
||||
|
||||
T *ret = last_elem->f_element;
|
||||
delete last_elem;
|
||||
|
||||
T ret_value = *ret;
|
||||
delete ret;
|
||||
|
||||
return(ret_value);
|
||||
}
|
||||
|
||||
void push (const T newItem)
|
||||
{
|
||||
Items->append ( newItem );
|
||||
}
|
||||
|
||||
T& top () const
|
||||
{
|
||||
CC_Link<T> *last_elem = (CC_Link<T> *)Items->last();
|
||||
if ( !last_elem ) {
|
||||
throw(Exception());
|
||||
}
|
||||
|
||||
return ( *last_elem->f_element );
|
||||
}
|
||||
|
||||
int entries() const
|
||||
{
|
||||
return( Items->entries() ); //ie no. of elements in the stack
|
||||
}
|
||||
|
||||
int empty() const {
|
||||
return( Items->entries() == 0 );
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
// $XConsortium: cc_exceptions.C /main/4 1996/08/21 15:48:54 drk $
|
||||
|
||||
#include "dti_cc/cc_exceptions.h"
|
||||
using namespace std;
|
||||
|
||||
ostream& ccException::asciiOut(ostream& out)
|
||||
{
|
||||
|
@ -43,7 +44,7 @@ ostream& ccBoundaryException::asciiOut(ostream& out)
|
|||
{
|
||||
cerr << low << "\t";
|
||||
cerr << high << "\t";
|
||||
cerr << index << "\n";
|
||||
cerr << mindex << "\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
#ifndef _cc_exception_h
|
||||
#define _cc_exception_h 1
|
||||
|
||||
#include <fstream.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#include "Exceptions.hh"
|
||||
|
||||
#define END_TRY end_try
|
||||
|
@ -36,15 +38,9 @@
|
|||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if defined(linux)
|
||||
#define CASTCCEXCEPT (ccException*)
|
||||
#define CASTCCSEXCEPT (ccStringException*)
|
||||
#define CASTCCBEXCEPT (ccBoundaryException*)
|
||||
#else
|
||||
#define CASTCCEXCEPT
|
||||
#define CASTCCSEXCEPT
|
||||
#define CASTCCBEXCEPT
|
||||
#endif
|
||||
|
||||
class ccException : public Exception
|
||||
{
|
||||
|
@ -69,7 +65,7 @@ protected:
|
|||
public:
|
||||
DECLARE_EXCEPTION(ccStringException, ccException);
|
||||
|
||||
ccStringException(char* m) : msg(m) {};
|
||||
ccStringException(char const* m) : msg((char*)m) {};
|
||||
~ccStringException() {};
|
||||
|
||||
virtual ostream& asciiOut(ostream&);
|
||||
|
@ -81,13 +77,13 @@ class ccBoundaryException : public ccException
|
|||
protected:
|
||||
int low;
|
||||
int high;
|
||||
int index;
|
||||
int mindex;
|
||||
|
||||
public:
|
||||
DECLARE_EXCEPTION(ccBoundaryException, ccException);
|
||||
|
||||
ccBoundaryException(int l, int h, int i) :
|
||||
low(l), high(h), index(i) {};
|
||||
low(l), high(h), mindex(i) {};
|
||||
~ccBoundaryException() {};
|
||||
|
||||
virtual ostream& asciiOut(ostream&);
|
||||
|
|
|
@ -1,30 +1,8 @@
|
|||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these librararies and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
// $TOG: cc_hdict.C /main/5 1998/04/17 11:45:00 mgreess $
|
||||
|
||||
#include "dti_cc/cc_exceptions.h"
|
||||
|
||||
#if !defined(__osf__) && !defined(linux)
|
||||
#if !defined(__osf__)
|
||||
template <class K, class V> CC_Boolean kv_pair<K, V>::f_needRemove = FALSE;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
#include "dti_cc/cc_pvect.h"
|
||||
#include "dti_cc/CC_Slist.h"
|
||||
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
template <class K, class V>
|
||||
class kv_pair {
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#define _cc_dlist_array_h
|
||||
|
||||
#include "dti_cc/CC_Dlist.h"
|
||||
#include "dti_cc/cc_exceptions.h"
|
||||
|
||||
template <class T>
|
||||
class dlist_array : public CC_TPtrDlist<T>
|
||||
|
@ -46,6 +47,21 @@ public:
|
|||
T* first() ;
|
||||
*/
|
||||
|
||||
T* at(size_t pos) const /* throw boundaryException
|
||||
* if list size is smaller than pos
|
||||
*/
|
||||
{
|
||||
// Hack to get it passed to iter
|
||||
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
|
||||
for ( int i = 0; i <=pos; i++ ) {
|
||||
if ( !(++iter) ) {
|
||||
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
|
||||
}
|
||||
}
|
||||
|
||||
return( iter.key() );
|
||||
}
|
||||
|
||||
T* operator()(size_t i) const { return at(i); };
|
||||
T* operator[](size_t i) const { return at(i); };
|
||||
};
|
||||
|
|
|
@ -50,7 +50,7 @@ pointer_vector<T>::~pointer_vector()
|
|||
}
|
||||
|
||||
template <class T>
|
||||
T* pointer_vector<T>::operator[](size_t i) const
|
||||
T* pointer_vector<T>::operator[](ptrdiff_t i) const
|
||||
{
|
||||
if ( i<0 || i>= f_size )
|
||||
throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
|
||||
|
@ -59,7 +59,7 @@ T* pointer_vector<T>::operator[](size_t i) const
|
|||
}
|
||||
|
||||
template <class T>
|
||||
T*& pointer_vector<T>::operator[](size_t i)
|
||||
T*& pointer_vector<T>::operator[](ptrdiff_t i)
|
||||
{
|
||||
if ( i<0 || i>= f_size )
|
||||
throw(CASTCCBEXCEPT ccBoundaryException(0, f_size-1, i));
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#ifndef _cc_pvector_h
|
||||
#define _cc_pvector_h 1
|
||||
|
||||
#include <stddef.h>
|
||||
#include "dti_cc/types.h"
|
||||
|
||||
template <class T>
|
||||
|
@ -45,8 +46,8 @@ public:
|
|||
pointer_vector(size_t, T* = 0);
|
||||
~pointer_vector();
|
||||
|
||||
T* operator[](size_t) const;
|
||||
T*& operator[](size_t);
|
||||
T* operator[](ptrdiff_t) const;
|
||||
T*& operator[](ptrdiff_t);
|
||||
|
||||
// size_t entries() const { return f_items; };
|
||||
size_t length() const { return f_size; };
|
||||
|
|
|
@ -80,7 +80,7 @@ Destructable::~Destructable()
|
|||
inline void
|
||||
Destructable::destruct()
|
||||
{
|
||||
#if defined(linux)
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
delete this;
|
||||
#else
|
||||
// Have to call this here since some compilers don't allow
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
// $TOG: Exception.hh /main/11 1998/04/20 09:55:15 mgreess $
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#define G_TEMP_SPACE_SIZE 1024
|
||||
|
||||
#if defined(linux)
|
||||
#define CASTEXCEPT (Exception*)
|
||||
#else
|
||||
#define CASTEXCEPT
|
||||
#endif
|
||||
|
||||
class Exception : public Destructable
|
||||
{
|
||||
|
@ -158,7 +154,7 @@ private:
|
|||
{ Exception *temp; \
|
||||
if (in_stack()) { \
|
||||
temp = new (0) NAME (*this); \
|
||||
(Exception *) (((NAME *)temp)->f_temporary = 1); \
|
||||
((NAME *)temp)->f_temporary = 1; \
|
||||
} else \
|
||||
temp = this; \
|
||||
temp->do_throw (line, file, dbg); } \
|
||||
|
|
|
@ -43,42 +43,47 @@ char* Exceptions::f_msg_out_of_exception_memory = 0;
|
|||
char* Exceptions::f_msg_out_of_obj_stack_memory = 0;
|
||||
char* Exceptions::f_msg_memory_already_freed = 0;
|
||||
#else
|
||||
char *Exceptions::f_msg_internal_error = "Internal exceptions error:";
|
||||
char *Exceptions::f_msg_application_error = "Application exceptions error:";
|
||||
char *Exceptions::f_msg_throw_message = "Application threw exception:";
|
||||
char *Exceptions::f_msg_internal_error =
|
||||
(char*)"Internal exceptions error:";
|
||||
|
||||
char *Exceptions::f_msg_application_error =
|
||||
(char*)"Application exceptions error:";
|
||||
|
||||
char *Exceptions::f_msg_throw_message =
|
||||
(char*)"Application threw exception:";
|
||||
|
||||
char *Exceptions::f_msg_not_initialized =
|
||||
"Exceptions library not initialized with INIT_EXCEPTIONS().";
|
||||
(char*)"Exceptions library not initialized with INIT_EXCEPTIONS().";
|
||||
|
||||
char *Exceptions::f_msg_initialized_twice =
|
||||
"Attept to call INIT_EXCEPTIONS() more than once.";
|
||||
(char*)"Attept to call INIT_EXCEPTIONS() more than once.";
|
||||
|
||||
char *Exceptions::f_msg_not_caught =
|
||||
"Exception not caught.";
|
||||
(char*)"Exception not caught.";
|
||||
|
||||
char *Exceptions::f_msg_no_current_exception =
|
||||
"There is no current exception (for catch or rethrow).";
|
||||
(char*)"There is no current exception (for catch or rethrow).";
|
||||
|
||||
char *Exceptions::f_msg_throw_from_terminate =
|
||||
"Exceptions may not be thrown from terminate.";
|
||||
(char*)"Exceptions may not be thrown from terminate.";
|
||||
|
||||
char *Exceptions::f_msg_throw_from_error_handler =
|
||||
"Exceptions may not be thrown from error handler.";
|
||||
(char*)"Exceptions may not be thrown from error handler.";
|
||||
|
||||
char *Exceptions::f_msg_throw_from_destructor =
|
||||
"Exited destructor with throw while handling an exception.";
|
||||
(char*)"Exited destructor with throw while handling an exception.";
|
||||
|
||||
char *Exceptions::f_msg_throw_ptr_to_stack =
|
||||
"Threw a pointer to an automatic (stack-based) exceptions object.";
|
||||
(char*)"Threw a pointer to an automatic (stack-based) exceptions object.";
|
||||
|
||||
char *Exceptions::f_msg_out_of_exception_memory =
|
||||
"Not enough memory to allocate an exception object.";
|
||||
(char*)"Not enough memory to allocate an exception object.";
|
||||
|
||||
char *Exceptions::f_msg_out_of_obj_stack_memory =
|
||||
"Not enough memory to allocate object stack.";
|
||||
(char*)"Not enough memory to allocate object stack.";
|
||||
|
||||
char *Exceptions::f_msg_memory_already_freed =
|
||||
"Tried to alloc or realloc pool memory that was previously freed.";
|
||||
(char*)"Tried to alloc or realloc pool memory that was previously freed.";
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -183,7 +188,7 @@ Exceptions::error (const char *message, error_type_t error_type)
|
|||
// Call user print function if set, otherwise just dump lines.
|
||||
if (g_error_handler != NULL)
|
||||
{
|
||||
try
|
||||
mtry
|
||||
{
|
||||
// Reset global variable to NULL before calling to prevent
|
||||
// the possibility of recursive calls.
|
||||
|
@ -191,7 +196,7 @@ Exceptions::error (const char *message, error_type_t error_type)
|
|||
(*current) ((const char**)lines, count);
|
||||
set_error_handler (current);
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
// Error handler will be NULL at this point.
|
||||
Exceptions::error (Exceptions::f_msg_throw_from_error_handler,
|
||||
|
|
|
@ -4,14 +4,27 @@
|
|||
|
||||
#define _Exceptions_hh_active
|
||||
|
||||
#ifndef C_API
|
||||
#ifndef NATIVE_EXCEPTIONS
|
||||
#define NATIVE_EXCEPTIONS
|
||||
#endif
|
||||
#define Exception mException
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_EXCEPTIONS
|
||||
extern "C" {
|
||||
#include <setjmp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
}
|
||||
#else
|
||||
extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_EXCEPTIONS
|
||||
#ifdef EXC_DEBUG
|
||||
#define PRINTF(MSG) printf MSG
|
||||
#ifndef DEBUG
|
||||
|
@ -45,12 +58,14 @@ extern "C" {
|
|||
|
||||
#define INIT_EXCEPTIONS()
|
||||
|
||||
#define throw(OBJ) throw OBJ
|
||||
#define mthrow(OBJ) throw OBJ
|
||||
#define rethrow throw
|
||||
|
||||
#define catch_any() catch(...)
|
||||
#define catch_noarg(OBJ) catch(OBJ)
|
||||
#define catch(TYPE,OBJ) catch(TYPE OBJ)
|
||||
#define mtry try
|
||||
|
||||
#define mcatch_any() catch(...)
|
||||
#define mcatch_noarg(OBJ) catch(OBJ)
|
||||
#define mcatch(TYPE,OBJ) catch(TYPE OBJ)
|
||||
|
||||
#define end_try
|
||||
|
||||
|
@ -64,7 +79,7 @@ extern "C" {
|
|||
|
||||
// TRY MACRO
|
||||
|
||||
#define try \
|
||||
#define mtry \
|
||||
{ \
|
||||
Jump_Environment __jump_env; \
|
||||
if (setjmp (__jump_env.f_env) == 0) {
|
||||
|
@ -81,10 +96,10 @@ extern "C" {
|
|||
// This works if OBJ is an object or a pointer since Exception objects
|
||||
// overload operator ->.
|
||||
#if !defined(hpux) && !defined(USL)
|
||||
#define throw(OBJ) \
|
||||
#define mthrow(OBJ) \
|
||||
(OBJ)->throw_it (__LINE__, __FILE__, DEBUG_THROW_FLAG)
|
||||
#else
|
||||
#define throw(OBJ) \
|
||||
#define mthrow(OBJ) \
|
||||
OBJ->throw_it (__LINE__, __FILE__, DEBUG_THROW_FLAG)
|
||||
#endif
|
||||
|
||||
|
@ -105,16 +120,16 @@ extern "C" {
|
|||
#define PRINT_CATCH
|
||||
#endif
|
||||
|
||||
#define catch_any() \
|
||||
#define mcatch_any() \
|
||||
} else if (1) { \
|
||||
PRINT_CATCH
|
||||
|
||||
#define catch_noarg(OBJ) \
|
||||
#define mcatch_noarg(OBJ) \
|
||||
} else if (Exception::current_exception().isa (STRINGIFY(OBJ))) { \
|
||||
PRINT_CATCH
|
||||
|
||||
#define catch(TYPE,OBJ) \
|
||||
catch_noarg (TYPE) \
|
||||
#define mcatch(TYPE,OBJ) \
|
||||
mcatch_noarg (TYPE) \
|
||||
TYPE OBJ = (TYPE) Exception::current_exception();
|
||||
|
||||
#define end_try \
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
|
||||
EXCEPTION_DEFINES = -DHAS_TERMINATE
|
||||
|
|
|
@ -30,42 +30,42 @@
|
|||
void initialize_exception()
|
||||
{
|
||||
|
||||
Exceptions::f_msg_internal_error = "Internal exceptions error:";
|
||||
Exceptions::f_msg_application_error = "Application exceptions error:";
|
||||
Exceptions::f_msg_throw_message = "Application threw exception:";
|
||||
Exceptions::f_msg_internal_error = (char*)"Internal exceptions error:";
|
||||
Exceptions::f_msg_application_error = (char*)"Application exceptions error:";
|
||||
Exceptions::f_msg_throw_message = (char*)"Application threw exception:";
|
||||
|
||||
Exceptions::f_msg_not_initialized =
|
||||
"Exceptions library not initialized with INIT_EXCEPTIONS().";
|
||||
(char*)"Exceptions library not initialized with INIT_EXCEPTIONS().";
|
||||
|
||||
Exceptions::f_msg_initialized_twice =
|
||||
"Attept to call INIT_EXCEPTIONS() more than once.";
|
||||
(char*)"Attept to call INIT_EXCEPTIONS() more than once.";
|
||||
|
||||
Exceptions::f_msg_not_caught =
|
||||
"Exception not caught.";
|
||||
(char*)"Exception not caught.";
|
||||
|
||||
Exceptions::f_msg_no_current_exception =
|
||||
"There is no current exception (for catch or rethrow).";
|
||||
(char*)"There is no current exception (for catch or rethrow).";
|
||||
|
||||
Exceptions::f_msg_throw_from_terminate =
|
||||
"Exceptions may not be thrown from terminate.";
|
||||
(char*)"Exceptions may not be thrown from terminate.";
|
||||
|
||||
Exceptions::f_msg_throw_from_error_handler =
|
||||
"Exceptions may not be thrown from error handler.";
|
||||
(char*)"Exceptions may not be thrown from error handler.";
|
||||
|
||||
Exceptions::f_msg_throw_from_destructor =
|
||||
"Exited destructor with throw while handling an exception.";
|
||||
(char*)"Exited destructor with throw while handling an exception.";
|
||||
|
||||
Exceptions::f_msg_throw_ptr_to_stack =
|
||||
"Threw a pointer to an automatic (stack-based) exceptions object.";
|
||||
(char*)"Threw a pointer to an automatic (stack-based) exceptions object.";
|
||||
|
||||
Exceptions::f_msg_out_of_exception_memory =
|
||||
"Not enough memory to allocate an exception object.";
|
||||
(char*)"Not enough memory to allocate an exception object.";
|
||||
|
||||
Exceptions::f_msg_out_of_obj_stack_memory =
|
||||
"Not enough memory to allocate object stack.";
|
||||
(char*)"Not enough memory to allocate object stack.";
|
||||
|
||||
Exceptions::f_msg_memory_already_freed =
|
||||
"Tried to alloc or realloc pool memory that was previously freed.";
|
||||
(char*)"Tried to alloc or realloc pool memory that was previously freed.";
|
||||
|
||||
Unwind_Stack::g_stack = new Unwind_Record[UNWIND_STACK_SIZE];
|
||||
Exception::g_temp_space = new char[G_TEMP_SPACE_SIZE];
|
||||
|
|
|
@ -54,7 +54,8 @@ void class_name::operator delete( void* p )\
|
|||
|
||||
|
||||
#else
|
||||
#include <new.h>
|
||||
#include <new>
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ terminate()
|
|||
// abuse in the terminate handler.
|
||||
PFV handler = _terminate_handler;
|
||||
_terminate_handler = NULL;
|
||||
try
|
||||
mtry
|
||||
{
|
||||
(*handler)();
|
||||
}
|
||||
catch_any()
|
||||
mcatch_any()
|
||||
{
|
||||
Exceptions::error (Exceptions::f_msg_throw_from_terminate,
|
||||
Exceptions::APPLICATION_ERROR);
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
|
||||
#include <sys/time.h>
|
||||
#include <math.h>
|
||||
#include <fstream.h>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
#include <search.h>
|
||||
#include "dynhash/bucket.h"
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ atoi_larson* data_t::larson_convertor_ptr;
|
|||
atoi_pearson* data_t::pearson_convertor_ptr;
|
||||
#else
|
||||
atoi_larson data_t::larson_convertor;
|
||||
atoi_pearson data_t::pearson_convertor(MAXSHORT, 256);
|
||||
atoi_pearson data_t::pearson_convertor(SHRT_MAX, 256);
|
||||
#endif
|
||||
|
||||
data_t::data_t(data_t& d)
|
||||
|
@ -214,7 +214,7 @@ istream& operator >>(istream& i, data_t& d)
|
|||
delete d.key.str_key;
|
||||
|
||||
d.flag = (data_t::flag_type)atoi(buf);
|
||||
d.dt = voidPtr(atoi(voidPtr_ptr));
|
||||
d.dt = (voidPtr)(size_t)atoi(voidPtr_ptr);
|
||||
|
||||
if ( d.flag == data_t::INT )
|
||||
d.key.int_key = atoi(key_ptr);
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
#ifdef C_API
|
||||
#include "utility/c_iostream.h"
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
int steps[] = { 2, 3, 5, 7, 11, 13, 17, 21, 23, 29, 31, 37, 41, 43, 47, 51 };
|
||||
|
@ -129,7 +130,8 @@ void imp_die::alloc_table(int new_H)
|
|||
|
||||
void imp_die::init_table()
|
||||
{
|
||||
for ( int i = 0; i < B; i++ ) {
|
||||
int i;
|
||||
for ( i = 0; i < B; i++ ) {
|
||||
bucket_array[i] = 0 ;
|
||||
}
|
||||
for ( i = 0; i < H; i++ ) {
|
||||
|
@ -142,7 +144,8 @@ void imp_die::clean()
|
|||
n = 0;
|
||||
collect_all_keys();
|
||||
|
||||
for ( int i=0; i<B; i++ ) {
|
||||
int i;
|
||||
for ( i=0; i<B; i++ ) {
|
||||
if ( bucket_array[i] ) {
|
||||
delete bucket_array[i];
|
||||
bucket_array[i] = 0 ;
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API -DPORTABLE_DB
|
||||
|
|
|
@ -140,7 +140,8 @@ h_convertor(pms.v_n, 128, rnd)
|
|||
{
|
||||
v_bucket_array = new bucketPtr[v_no_buckets];
|
||||
|
||||
for ( int i=0; i<v_no_buckets; v_bucket_array[i++] = 0);
|
||||
int i;
|
||||
for ( i=0; i<v_no_buckets; v_bucket_array[i++] = 0);
|
||||
|
||||
//debug(cerr, pms);
|
||||
|
||||
|
@ -234,7 +235,8 @@ void buckets::sort_by_size()
|
|||
{
|
||||
//MESSAGE(cerr, "sort()");
|
||||
int* links = new int[v_no_buckets];
|
||||
for ( int i=0; i<v_no_buckets; links[i++]=-1 );
|
||||
int i;
|
||||
for ( i=0; i<v_no_buckets; links[i++]=-1 );
|
||||
|
||||
int* sizes = new int[v_max_bucket_sz+1];
|
||||
for ( i=0; i<v_max_bucket_sz+1; sizes[i++]=-1 );
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
//compute_a_mphf(char* key_file, params& pms, char* mphf_spec_file)
|
||||
|
||||
compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
|
||||
int compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
|
||||
{
|
||||
mphf_hash_table ht(pms);
|
||||
|
||||
|
@ -98,7 +98,7 @@ compute_a_mphf(char** keys, params& pms, buffer& mphf_buffer)
|
|||
return 1;
|
||||
}
|
||||
|
||||
search(buckets& bs, mphf_hash_table& ht, params& pms)
|
||||
int search(buckets& bs, mphf_hash_table& ht, params& pms)
|
||||
{
|
||||
int i = 0,
|
||||
fails = 0,
|
||||
|
@ -158,7 +158,7 @@ search(buckets& bs, mphf_hash_table& ht, params& pms)
|
|||
return ( patternFit >= 0 ) ? 0 : -1;
|
||||
}
|
||||
|
||||
verify(buckets& bs, mphf_hash_table& ht, params& pms)
|
||||
int verify(buckets& bs, mphf_hash_table& ht, params& pms)
|
||||
{
|
||||
int i;
|
||||
int_pattern new_pattern(bs.max_bucket_sz());
|
||||
|
@ -246,7 +246,7 @@ int write_spec(buckets& bs, params& pms, buffer& mphf_buffer)
|
|||
mphf_buffer.put((char*)c_array, g_array_bytes); mphf_buffer.put('\n');
|
||||
*/
|
||||
|
||||
ostrstream fout(mphf_buffer.get_base(), mphf_buffer.buf_sz(), ios::out);
|
||||
ostringstream fout(mphf_buffer.get_base(), ios::out);
|
||||
|
||||
fout << pms.v_n << "\n";
|
||||
fout << pms.v_b << "\n";
|
||||
|
@ -267,6 +267,7 @@ int write_spec(buckets& bs, params& pms, buffer& mphf_buffer)
|
|||
|
||||
|
||||
mphf_buffer.set_content_sz(spec_bytes);
|
||||
memcpy(mphf_buffer.get_base(), fout.str().c_str(), spec_bytes);
|
||||
|
||||
delete c_array;
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
#define _mphf_funcs_h 1
|
||||
|
||||
#ifdef C_API
|
||||
#include "utility/c_strstream.h"
|
||||
#include "utility/c_stringstream.h"
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
#include "utility/funcs.h"
|
||||
|
|
|
@ -152,10 +152,10 @@ int mphf_hash_table::fit_hash_table(int_pattern& pat)
|
|||
{
|
||||
int i, j;
|
||||
for ( i=0; i<pat.no_elmts(); i++ ) {
|
||||
if ( v_rep[int(pat[i])] != (int) NULL ) {
|
||||
if ( v_rep[int(pat[i])] != (int) 0 ) {
|
||||
|
||||
for ( j=0; j<=i; j++ )
|
||||
v_rep[int(pat[j])] = (int) NULL;
|
||||
v_rep[int(pat[j])] = (int) 0;
|
||||
|
||||
v_num_filled_slots -= i+1;
|
||||
return -1;
|
||||
|
|
|
@ -62,7 +62,8 @@ struct partition_t {
|
|||
|
||||
void params::select_value(float bts)
|
||||
{
|
||||
for ( int i=0; ; i++ ) {
|
||||
int i;
|
||||
for ( i=0; ; i++ ) {
|
||||
if ( v_n <= partition_tbl[i].upper_bound )
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,12 @@
|
|||
#ifndef _params_h
|
||||
#define _params_h 1
|
||||
|
||||
#include <limits.h>
|
||||
#if defined(CSRG_BASED)
|
||||
#define MAXINT INT_MAX
|
||||
#else
|
||||
#include <values.h>
|
||||
#endif
|
||||
#include "utility/funcs.h"
|
||||
|
||||
class params
|
||||
|
|
|
@ -78,7 +78,8 @@ void sorter::_init(istream& in)
|
|||
{
|
||||
v_bucket_array = new bucketPtr[NUM_BUCKETS];
|
||||
|
||||
for ( int i=0; i<NUM_BUCKETS; v_bucket_array[i++] = 0);
|
||||
int i;
|
||||
for ( i=0; i<NUM_BUCKETS; v_bucket_array[i++] = 0);
|
||||
|
||||
char key_buf[LBUFSIZ];
|
||||
|
||||
|
@ -105,7 +106,8 @@ void sorter::_init(istream& in)
|
|||
|
||||
sorter::~sorter()
|
||||
{
|
||||
for ( int i=0; i<NUM_BUCKETS; delete v_bucket_array[i++] );
|
||||
int i;
|
||||
for ( i=0; i<NUM_BUCKETS; delete v_bucket_array[i++] );
|
||||
delete v_bucket_array;
|
||||
|
||||
for ( i=0; i<v_no_unique_keys; delete v_unique_keys[i++] );
|
||||
|
@ -117,7 +119,8 @@ void sorter::filter_by_hash()
|
|||
// a small hash table for keys to map to
|
||||
v_map_table = new charPtr[2*v_max_bucket_sz];
|
||||
|
||||
for ( int i=0; i<2*v_max_bucket_sz; v_map_table[i++] = 0 );
|
||||
int i;
|
||||
for ( i=0; i<2*v_max_bucket_sz; v_map_table[i++] = 0 );
|
||||
|
||||
// an int table remembering slots in the v_map_table
|
||||
// that have been mapped.
|
||||
|
@ -283,7 +286,8 @@ void sorter::remove_keys(bucketPtr bkt, char* key, slist_void_ptr_cell* lp)
|
|||
|
||||
void sorter::assemble_unique_keys()
|
||||
{
|
||||
for ( int i=0; i<NUM_BUCKETS; i++ ) {
|
||||
int i;
|
||||
for ( i=0; i<NUM_BUCKETS; i++ ) {
|
||||
if ( v_bucket_array[i] ) {
|
||||
v_no_unique_keys += v_bucket_array[i] -> v_no_keys;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,12 @@
|
|||
#ifndef _sorter_h
|
||||
#define _sorter_h 1
|
||||
|
||||
#include <limits.h>
|
||||
#if defined(CSRG_BASED)
|
||||
#define MAXINT INT_MAX
|
||||
#else
|
||||
#include <values.h>
|
||||
#endif
|
||||
#include "utility/funcs.h"
|
||||
#include "utility/atoi_fast.h"
|
||||
#include "hmphf/buckets.h"
|
||||
|
|
|
@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
|||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API -DPORTABLE_DB
|
||||
|
|
|
@ -76,7 +76,7 @@ btree_index::~btree_index()
|
|||
delete v_idx_agent_ptr;
|
||||
}
|
||||
|
||||
int btree_index::handler_to_inv_idx(const handler& query)
|
||||
size_t btree_index::handler_to_inv_idx(const handler& query)
|
||||
{
|
||||
get_key_string(query);
|
||||
|
||||
|
@ -85,7 +85,7 @@ int btree_index::handler_to_inv_idx(const handler& query)
|
|||
if ( v_idx_agent_ptr -> member(k) == false )
|
||||
throw(stringException("first_of_invlist(): key is not in btree"));
|
||||
|
||||
return int(k.dt);
|
||||
return size_t(k.dt);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
//init run time data members
|
||||
Boolean init_data_member( inv_lists_handler*, const char* btree_store );
|
||||
|
||||
int handler_to_inv_idx(const handler& query);
|
||||
size_t handler_to_inv_idx(const handler& query);
|
||||
|
||||
MMDB_SIGNATURES(btree_index);
|
||||
};
|
||||
|
|
|
@ -72,7 +72,7 @@ dyn_disk_index::init_data_member(inv_lists_handler* y, abs_storage* store)
|
|||
return true;
|
||||
}
|
||||
|
||||
int dyn_disk_index::handler_to_inv_idx(const handler&)
|
||||
size_t dyn_disk_index::handler_to_inv_idx(const handler&)
|
||||
{
|
||||
throw(stringException("handler_to_int() not implemented"));
|
||||
return 0;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
//init run time data components
|
||||
Boolean init_data_member( inv_lists_handler*, abs_storage* );
|
||||
|
||||
int handler_to_inv_idx(const handler&);
|
||||
size_t handler_to_inv_idx(const handler&);
|
||||
|
||||
MMDB_SIGNATURES(dyn_disk_index);
|
||||
};
|
||||
|
|
|
@ -160,7 +160,7 @@ MESSAGE(cerr, "insert to list after");
|
|||
|
||||
(*v_inv_lists_hd) -> append_list(list);
|
||||
|
||||
intKey.dt = voidPtr((*v_inv_lists_hd) -> count());
|
||||
intKey.dt = (voidPtr)(size_t)(*v_inv_lists_hd) -> count();
|
||||
//debug(cerr, int(intKey.dt));
|
||||
|
||||
v_idx_agent_ptr -> insert( intKey );
|
||||
|
|
|
@ -93,7 +93,7 @@ dyn_memory_index::~dyn_memory_index()
|
|||
char buf[PATHSIZ];
|
||||
for ( int i=0; i<PATHSIZ; buf[i++]=0 );
|
||||
|
||||
ostrstream oid_t_out(buf, PATHSIZ);
|
||||
ostringstream oid_t_out(buf, PATHSIZ);
|
||||
my_oid().asciiOut(oid_t_out);
|
||||
*/
|
||||
|
||||
|
@ -106,7 +106,7 @@ dyn_memory_index::~dyn_memory_index()
|
|||
}
|
||||
}
|
||||
|
||||
int dyn_memory_index::handler_to_inv_idx(const handler&)
|
||||
size_t dyn_memory_index::handler_to_inv_idx(const handler&)
|
||||
{
|
||||
throw(stringException(
|
||||
"dyn_memory_index::handler_to_int(): not implemented yet"
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
//init run time data components
|
||||
Boolean init_data_member( inv_lists_handler*, abs_storage* );
|
||||
|
||||
int handler_to_inv_idx(const handler&);
|
||||
size_t handler_to_inv_idx(const handler&);
|
||||
|
||||
virtual Boolean remove_loc(handler&, const oid_t&);
|
||||
virtual Boolean remove_loc(const oid_t&, const oid_t&);
|
||||
|
|
|
@ -398,11 +398,14 @@ Boolean fast_mphf::build(istream& in)
|
|||
throw(stringException("finding a mphf failed"));
|
||||
}
|
||||
|
||||
istrstream strin(mphf_spec.get_base(), mphf_spec.content_sz());
|
||||
stringstream strin;
|
||||
|
||||
if ( !strin ) {
|
||||
throw(streamException(strin.rdstate()));
|
||||
}
|
||||
else {
|
||||
strin.write(mphf_spec.get_base(), mphf_spec.content_sz());
|
||||
}
|
||||
|
||||
asciiIn(strin);
|
||||
|
||||
|
|
|
@ -107,10 +107,11 @@ oid_t c_index::first_of_invlist(int ind)
|
|||
|
||||
Boolean c_index::get_key_string(const handler& t) const
|
||||
{
|
||||
ostrstream out(v_static_key.get(), v_static_key.alloc_size());
|
||||
ostringstream out(v_static_key.get());
|
||||
|
||||
((handler&)t) -> asciiOut(out);
|
||||
v_static_key.set_size(out.pcount());
|
||||
v_static_key.set_size(out.str().size());
|
||||
strcpy(v_static_key.get(), out.str().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -119,10 +120,11 @@ Boolean c_index::get_key_string(const oid_t& t) const
|
|||
{
|
||||
v_static_key.reset();
|
||||
|
||||
ostrstream out(v_static_key.get(), v_static_key.alloc_size());
|
||||
ostringstream out(v_static_key.get());
|
||||
t.asciiOut(out);
|
||||
|
||||
v_static_key.set_size(out.pcount());
|
||||
v_static_key.set_size(out.str().size());
|
||||
strcpy(v_static_key.get(), out.str().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
#define _index_h 1
|
||||
|
||||
#ifdef C_API
|
||||
#include "utility/c_strstream.h"
|
||||
#include "utility/c_stringstream.h"
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
#include "object/oid_list.h"
|
||||
|
@ -100,7 +100,7 @@ public:
|
|||
virtual int invlist_length(handler&) = 0;
|
||||
|
||||
// translate a query to an index of an inv_list
|
||||
virtual int handler_to_inv_idx(const handler& query) = 0;
|
||||
virtual size_t handler_to_inv_idx(const handler& query) = 0;
|
||||
|
||||
// status inquiry functions
|
||||
int bound_to() const { return v_cmp_selector; } ;
|
||||
|
|
|
@ -151,7 +151,7 @@ MESSAGE(cerr, "inv::insert");
|
|||
debug(cerr, index);
|
||||
*/
|
||||
|
||||
if ( INRANGE(list_id.ccode(), 0, 1) &&
|
||||
if ( INRANGE((short)list_id.ccode(), 0, 1) &&
|
||||
id.ccode() != OID_LIST_CODE
|
||||
) {
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue