General commit

Making some progress on the windows version, but not finished.
This commit is contained in:
Harry Moffat
2009-03-28 03:07:23 +00:00
parent 5bea0f92cc
commit 89d8691747
5 changed files with 29 additions and 24 deletions

View File

@@ -936,7 +936,7 @@ namespace VCSnonideal {
Cantera::ThermoPhase *tPhase = 0;
int iSurPhase = -1;
int gasPhase;
bool gasPhase;
int printLvl = vprob->m_printLvl;
/*
@@ -957,8 +957,8 @@ namespace VCSnonideal {
* current phase.
*/
int eos = tPhase->eosType();
if (eos == cIdealGas) gasPhase = 1;
else gasPhase = 0;
if (eos == cIdealGas) gasPhase = true;
else gasPhase = false;
/*
* Find out the number of species in the phase

View File

@@ -30,7 +30,7 @@ int iDebug_HKM = 0;
/*****************************************************************/
static void printUsage()
{
cout << "ctitoxml [-h] infile.cti" << endl;
cout << "cti2ctml [-h] infile.cti" << endl;
cout << " Translates a cti formated file to an xml file" << endl;
cout << " The xml file will be named infile.xml" << endl;
}
@@ -76,16 +76,9 @@ int main(int argc, char** argv) {
XML_Node *xc = new XML_Node();
string path = findInputFile(infile);
ctml::get_CTML_Tree(xc, path, 0);
XML_Node *xd = new XML_Node();
xc->copy(xd);
ofstream tout;
tout.open("testdest.xml");
xc->write(tout);
tout.close();
tout.open("testdest2.xml");
xd->write(tout);
tout.close();
//XML_Node *xd = new XML_Node();
//xc->copy(xd);
}
catch (CanteraError) {
showErrors(cout);

View File

@@ -17,6 +17,10 @@
#include "mdp_allo.h"
#ifdef WIN32
#pragma warning(disable:4996)
#endif
/*
* Allocate global storage for 2 debugging ints that are used in IO of
* error information.
@@ -54,7 +58,7 @@ int MDP_ALLO_errorOption = 3;
/****************************************************************************/
/****************************************************************************/
static void mdp_alloc_eh(const char *rname, int bytes)
static void mdp_alloc_eh(const char *rname, size_t bytes)
/*************************************************************************
*

View File

@@ -16,12 +16,11 @@
* $Source$
*
*====================================================================*/
#ifndef lint
static char const rcsid[] =
"$Id$";
#ifdef WIN32
#pragma warning(disable:4996)
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -789,7 +788,7 @@ char *scan_for_string(FILE *ifp, const char *string, const int maxVal,
* handled by terminally exiting the program.
*/
{
int len;
size_t len;
char input[MAX_INPUT_STR_LN + 1];
if (scan_for_line(ifp, string, input, KEY_CHAR, PrintInputFile) < 0)
exit(-1);
@@ -1305,7 +1304,7 @@ char *TokToStrng (const TOKEN *keyptr)
int i;
if (!keyptr) return NULL;
if (!keyptr->orig_str) return NULL;
int iln = strlen(keyptr->orig_str) + 1 + keyptr->ntokes;
size_t iln = strlen(keyptr->orig_str) + 1 + keyptr->ntokes;
char *fstr = (char *) malloc(iln * sizeof(char));
char *const*str = &(keyptr->tok_ptr[0]);
@@ -1550,10 +1549,19 @@ void strip_item_from_token(int iword, TOKEN *tok)
{
if (!tok) return;
if (iword < 0 || iword > tok->ntokes) return;
#ifdef WIN32
__w64 int ioffset = tok->tok_ptr[iword] - tok->tok_str;
#else
int ioffset = tok->tok_ptr[iword] - tok->tok_str;
int ilength = strlen(tok->tok_ptr[iword]);
#endif
size_t ilength = strlen(tok->tok_ptr[iword]);
#ifdef WIN32
__w64 int i = ioffset;
__w64 int j = ioffset + ilength;
#else
int i = ioffset;
int j = ioffset + ilength;
#endif
if (j <= (int) strlen(tok->orig_str)) {
while(tok->orig_str[j] != '\0') {
tok->orig_str[i] = tok->orig_str[j];

View File

@@ -45,9 +45,9 @@ typedef int ftnlen; // Fortran hidden string length type
#define FTN_TRAILING_UNDERSCORE 1
/* #undef HAS_SUNDIALS */
#define HAS_SUNDIALS 1
/* #undef SUNDIALS_VERSION_22 */
/* #undef SUNDIALS_VERSION_23 */
#define SUNDIALS_VERSION_23 1
//-------- LAPACK / BLAS ---------