mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
General commit
Making some progress on the windows version, but not finished.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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 ---------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user