Commit 6d2f2e36 authored by Daniel Leidert's avatar Daniel Leidert

New upstream version 161002

parent 94958626
......@@ -32,10 +32,10 @@ CXX = g++
# You should not need to edit the following part
#**************************************************************************
CFLAGS = -g -Wall -Wextra -pedantic -ansi -O2 $(FFTW_INCLUDE)
CFLAGS_PROF = -g -Wall -Wextra -pedantic -ansi -O2 -pg $(FFTW_INCLUDE)
CFLAGS_DEB = -g -Wall -Wextra -pedantic -ansi -O0 $(FFTW_INCLUDE)
CFLAGS_REL = -g -Wall -Wextra -pedantic -ansi -O3 $(FFTW_INCLUDE) -march=athlon-fx
CFLAGS = -g -Wall -Wextra -Wformat -Wformat-security -pedantic -ansi -O2 $(FFTW_INCLUDE)
CFLAGS_PROF = -g -Wall -Wextra -Wformat -Wformat-security -pedantic -ansi -O2 -pg $(FFTW_INCLUDE)
CFLAGS_DEB = -g -Wall -Wextra -Wformat -Wformat-security -pedantic -ansi -O0 $(FFTW_INCLUDE)
CFLAGS_REL = -g -Wall -Wextra -Wformat -Wformat-security -pedantic -ansi -O3 $(FFTW_INCLUDE) -march=athlon-fx
LDFLAGS = $(FFTW_LIB)
SRC = $(wildcard src/*.cpp)
......
......@@ -81,7 +81,7 @@ CChiralObservation::CChiralObservation() {
// strncat(buf, ")? ", remaining - 1);
buf.strcat(")? ");
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
m_iShowMol = 0;
}
......
......@@ -26,10 +26,10 @@
#define CONFIG_H
#define SOURCE_VERSION "Sep 19 2016"
#define SOURCE_VERSION "Oct 02 2016"
// Uncomment the following line for an official release
//#define RELEASE_VERSION "1.14.0"
#define RELEASE_VERSION "1.14.0"
/* Please uncomment / comment out the flags you want to use / not to use. */
......
......@@ -80,7 +80,7 @@ void CDACF::Parse()
}
// strcat(buf,"): ");
buf.strcat("): ");
m_iFirstMol = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
m_iFirstMol = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
// sprintf(buf," Enter second molecule for aggregation (");
buf.sprintf(" Enter second molecule for aggregation (");
......@@ -97,7 +97,7 @@ void CDACF::Parse()
}
// strcat(buf,"): ");
buf.strcat("): ");
m_iSecondMol = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
m_iSecondMol = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else
{
m_iFirstMol = 0;
......
......@@ -51,7 +51,7 @@ CFDFObservation::CFDFObservation() : CObservation() {
buf.strcat(", ");
}
buf.strcat(")? ");
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
m_iShowMol = 0;
mprintf(" Observing molecule %s.\n\n", ((CMolecule *)g_oaMolecules[m_iShowMol])->m_sName);
......
......@@ -1454,7 +1454,7 @@ _fin:
}
// strcat(buf,")? ");
buf.strcat(")? ");
ti = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize())-1;
ti = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf)-1;
mol = (CMolecule*)g_oaMolecules[ti];
mol->m_oaNewNumbers.SetSize(mol->m_baAtomIndex.GetSize());
for (z=0;z<mol->m_baAtomIndex.GetSize();z++)
......@@ -1592,7 +1592,7 @@ _fin:
// strcat(buf,")? ");
buf.strcat(")? ");
z = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize());
z = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf);
va = AddVirtualAtom(z-1);
mprintf(WHITE,"\n*** Defining virtual atom #%d in %s\n",va->m_iMolVirtAtom+1,((CMolecule*)g_oaMolecules[va->m_iMolecule])->m_sName);
va->m_iMode = AskRangeInteger(" Define v.a. as center (0) or through distance/angle/dihedral (1)? [center] ",0,1,0);
......@@ -2454,7 +2454,7 @@ _entertype:
}
// strcat(buf,")? ");
buf.strcat(")? ");
g_iFixMol = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
g_iFixMol = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else g_iFixMol = 0;
mprintf(WHITE,"\n %s is the reference molecule.\n\n",((CMolecule*)g_oaMolecules[g_iFixMol])->m_sName);
} else g_iFixMol = -1;
......@@ -2817,7 +2817,7 @@ _obsmolagain:
// strcat(buf,")? ");
buf.strcat(")? ");
o->m_iShowMol = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
o->m_iShowMol = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
if ((((CMolecule*)g_oaMolecules[o->m_iShowMol])->m_laSingleMolIndex.GetSize() == 1) && (o->m_iShowMol == g_iFixMol))
{
eprintf("Error: There is only 1 molecule of %s.\n--> Intermolecular observation between %s and %s not possible.\n\n",((CMolecule*)g_oaMolecules[o->m_iShowMol])->m_sName,((CMolecule*)g_oaMolecules[o->m_iShowMol])->m_sName,((CMolecule*)g_oaMolecules[o->m_iShowMol])->m_sName);
......@@ -2850,7 +2850,7 @@ _obsmol2again:
// strcat(buf,")? ");
buf.strcat(")? ");
o->m_iShowMol2 = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
o->m_iShowMol2 = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
if ((((CMolecule*)g_oaMolecules[o->m_iShowMol2])->m_laSingleMolIndex.GetSize() == 1) && (o->m_iShowMol2 == g_iFixMol))
{
eprintf("Error: There is only 1 molecule of %s.\n --> Intermolecular observation between %s and %s not possible.\n\n",((CMolecule*)g_oaMolecules[o->m_iShowMol2])->m_sName,((CMolecule*)g_oaMolecules[o->m_iShowMol2])->m_sName,((CMolecule*)g_oaMolecules[o->m_iShowMol2])->m_sName);
......@@ -4199,7 +4199,7 @@ _sdf_norm_again:
}
// strcat(buf,")? ");
buf.strcat(")? ");
g_iSaveJustMol = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
g_iSaveJustMol = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else
{
g_iSaveJustMol = 0;
......@@ -4506,7 +4506,7 @@ _norot:
}
// strcat(buf," [1] ");
buf.strcat(" [1] ");
g_iNumberPos = AskRangeInteger(buf,1,g_TimeStep.GetCommentNumberCount(),1) - 1;
g_iNumberPos = AskRangeInteger("%s",1,g_TimeStep.GetCommentNumberCount(),1,(const char*)buf) - 1;
} else
{
if (!AskYesNo(" Is %ld the time step number of the first time step (y/n)? [yes] ",true,g_TimeStep.ExtractNumber(0)))
......
......@@ -88,7 +88,7 @@ CPowerObservation::CPowerObservation(bool global) {
}
// strncat(buf, ")? ", remaining - 1);
buf.strcat(")? ");
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else {
m_iShowMol = 0;
mprintf(" Observing molecule %s.\n", ((CMolecule *)g_oaMolecules[m_iShowMol])->m_sName);
......@@ -615,7 +615,7 @@ CIRObservation::CIRObservation(bool global) {
}
}
strncat(buf, ")? ", remaining - 1);
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else {
m_iShowMol = 0;
mprintf(" Observing molecule %s.\n", ((CMolecule *)g_oaMolecules[m_iShowMol])->m_sName);
......@@ -1263,7 +1263,7 @@ CVCDObservation::CVCDObservation(bool global) {
}
}
strncat(buf, ")? ", remaining - 1);
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else {
m_iShowMol = 0;
}
......@@ -1892,9 +1892,9 @@ bool gatherSortWannier() {
CxString buf3;
if(watom == -1)
AskString_ND(buf, &buf3);
AskString_ND("%s", &buf3, (const char*)buf);
else
AskString(buf, &buf3, ((CAtom *)g_oaAtoms[watom])->m_sName);
AskString("%s", &buf3, ((CAtom *)g_oaAtoms[watom])->m_sName, (const char*)buf);
for(i = 0; i < g_oaAtoms.GetSize() - 1; i++) {
if(mystricmp((const char *)buf3, ((CAtom *)g_oaAtoms[i])->m_sName) == 0) {
......
......@@ -3416,9 +3416,9 @@ bool setupWannier() {
}
if(watom == -1)
AskString_ND(buf, &buf2);
AskString_ND("%s", &buf2, (const char*)buf);
else
AskString(buf, &buf2, ((CAtom *)g_oaAtoms[watom])->m_sName);
AskString("%s", &buf2, ((CAtom *)g_oaAtoms[watom])->m_sName, (const char*)buf);
for(i = 0; i < g_oaAtoms.GetSize() - 1; i++) {
if(mystricmp(buf2, ((CAtom *)g_oaAtoms[i])->m_sName) == 0) {
......@@ -3745,7 +3745,7 @@ void ParseDipole()
}
buf.strcat(")? ");
mol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
mol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
mol = 0;
}
......@@ -3880,7 +3880,7 @@ void ParseDipole()
if (b)
{
buf.strcat(": [0.0] ");
tf = AskFloat(buf,0);
tf = AskFloat("%s",0, (const char*)buf);
for (z3=0;z3<ti;z3++)
tfa->Add(tf);
td -= 1.0;
......@@ -5173,7 +5173,7 @@ void parseMagneticDipole() {
}
buf.strcat(")? ");
mol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
mol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
mol = 0;
}
......@@ -5308,7 +5308,7 @@ void parseMagneticDipole() {
if (b)
{
buf.strcat(": [0.0] ");
tf = AskFloat(buf,0);
tf = AskFloat("%s",0, (const char*)buf);
for (z3=0;z3<ti;z3++)
tfa->Add(tf);
td -= 1.0;
......
......@@ -2155,7 +2155,7 @@ CNormalCoordinateObservation::CNormalCoordinateObservation() {
// strncat(buf, ")? ", remaining - 1);
buf.strcat(")? ");
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
m_iShowMol = 0;
}
......
......@@ -311,7 +311,7 @@ CPDFObservation::CPDFObservation() {
// strncat(buf, ")? ", remaining - 1);
buf.strcat(")? ");
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(), (const char*)buf) - 1;
} else {
m_iShowMol = 0;
}
......
......@@ -91,7 +91,7 @@ _plprojatoms:
_drawagain:
// sprintf(buf," Draw reference atoms (%s%d, %s%d, %s%d) in plot (y/n)? [yes] ",((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1);
buf.sprintf(" Draw reference atoms (%s%d, %s%d, %s%d) in plot (y/n)? [yes] ",((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1);
if (AskYesNo(buf,true))
if (AskYesNo("%s",true,(const char*)buf))
{
// sprintf(buf,"%s%d,%s%d,%s%d",((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1);
buf.sprintf("%s%d,%s%d,%s%d",((CAtom*)g_oaAtoms[g_iFixRealAtomType[0]])->m_sName,g_iFixAtom[0]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[1]])->m_sName,g_iFixAtom[1]+1,((CAtom*)g_oaAtoms[g_iFixRealAtomType[2]])->m_sName,g_iFixAtom[2]+1);
......
......@@ -988,7 +988,7 @@ CRamanObservation::CRamanObservation(bool global) {
}
}
strncat(buf, ")? ", remaining - 1);
m_iShowMol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
m_iShowMol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
} else {
m_iShowMol = 0;
mprintf(" Observing molecule %s.\n", ((CMolecule *)g_oaMolecules[m_iShowMol])->m_sName);
......
......@@ -124,7 +124,7 @@ _quantityagain:
// strcat(buf,")? ");
buf.strcat(")? ");
ti = AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
ti = AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
for (z=0;z<m_oaAtomGroups.GetSize();z++)
{
......
......@@ -802,7 +802,7 @@ CStructureFactorGroup::CStructureFactorGroup(bool global, CxObArray &isotopeAssi
}
buf.strcat(")? ");
int mol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
int mol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
CAtomGroup *ag;
try { ag = new CAtomGroup(); } catch(...) { ag = NULL; }
......@@ -1567,7 +1567,7 @@ CStructureFactor::CStructureFactor() {
buf.strcat(", ");
}
buf.strcat(")? ");
int mol = AskRangeInteger_ND(buf, 1, g_oaMolecules.GetSize()) - 1;
int mol = AskRangeInteger_ND("%s", 1, g_oaMolecules.GetSize(),(const char*)buf) - 1;
CMolecule *m = (CMolecule *)g_oaMolecules[mol];
while (true) {
......
......@@ -205,7 +205,7 @@ bool AskYesNo(const char *s, bool def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -258,7 +258,7 @@ bool AskYesNo_ND(const char *s, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -313,7 +313,7 @@ int AskUnsignedInteger(const char *s, int def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -368,7 +368,7 @@ int AskInteger(const char *s, int def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -423,7 +423,7 @@ int AskUnsignedInteger_ND(const char *s, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -479,7 +479,7 @@ int AskRangeInteger(const char *s, int mini, int maxi, int def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -534,7 +534,7 @@ double AskRangeFloat(const char *s, double mini, double maxi, double def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -589,7 +589,7 @@ int AskRangeInteger_ND(const char *s, int mini, int maxi, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -705,7 +705,7 @@ void AskString_ND(const char *s, CxString *buf, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -746,7 +746,7 @@ void AskString(const char *s, CxString *buf, const char *def, ...)
XVSPRINTF_WINDOWS(obuf,s,def);
#endif
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -789,7 +789,7 @@ double AskFloat_ND(const char *s, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -845,7 +845,7 @@ double AskFloat(const char *s, double def, ...)
#endif
_again:
mprintf(obuf);
mprintf("%s",(const char*)obuf);
p = obuf;
while ((*p == ' ') || (*p == '\n'))
p++;
......@@ -900,7 +900,7 @@ int AskMolecule(const char *s)
}
// strcat(buf,")? ");
buf.strcat(")? ");
return AskRangeInteger_ND(buf,1,g_oaMolecules.GetSize()) - 1;
return AskRangeInteger_ND("%s",1,g_oaMolecules.GetSize(),(const char*)buf) - 1;
}
......
......@@ -124,9 +124,6 @@ int main(int argc, const char *argv[])
unsigned long tul;
#endif
// TestPseudoInverse();
// return 0;
InitGlobalVars();
......
......@@ -529,7 +529,7 @@ CxString CxString::Left(int count) const
void CxString::Dump()
{
BXIN;
mprintf(m_pData);
mprintf("%s",m_pData);
BXOUT;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment