Fix for VC++ compile.

This commit is contained in:
rogerl%netscape.com 2001-01-02 19:49:16 +00:00
parent 2266954d60
commit 2c115aa7b4
2 changed files with 4 additions and 4 deletions

View File

@ -157,7 +157,7 @@ static JSValue load(Context *cx, const JSValues &argv)
for (size_t i = 1; i < n; ++i) { for (size_t i = 1; i < n; ++i) {
JSValue val = argv[i].toString(); JSValue val = argv[i].toString();
if (val.isString()) { if (val.isString()) {
JSString& fileName(*val.string); JSString& fileName = *val.string;
std::string str(fileName.length(), char()); std::string str(fileName.length(), char());
std::transform(fileName.begin(), fileName.end(), str.begin(), narrow); std::transform(fileName.begin(), fileName.end(), str.begin(), narrow);
FILE* f = fopen(str.c_str(), "r"); FILE* f = fopen(str.c_str(), "r");
@ -179,7 +179,7 @@ static JSValue loadxml(Context *cx, const JSValues &argv)
for (size_t i = 1; i < n; ++i) { for (size_t i = 1; i < n; ++i) {
JSValue val = argv[i].toString(); JSValue val = argv[i].toString();
if (val.isString()) { if (val.isString()) {
JSString& fileName(*val.string); JSString& fileName = *val.string;
std::string str(fileName.length(), char()); std::string str(fileName.length(), char());
std::transform(fileName.begin(), fileName.end(), str.begin(), narrow); std::transform(fileName.begin(), fileName.end(), str.begin(), narrow);
cx->loadClass(str.c_str()); cx->loadClass(str.c_str());

View File

@ -157,7 +157,7 @@ static JSValue load(Context *cx, const JSValues &argv)
for (size_t i = 1; i < n; ++i) { for (size_t i = 1; i < n; ++i) {
JSValue val = argv[i].toString(); JSValue val = argv[i].toString();
if (val.isString()) { if (val.isString()) {
JSString& fileName(*val.string); JSString& fileName = *val.string;
std::string str(fileName.length(), char()); std::string str(fileName.length(), char());
std::transform(fileName.begin(), fileName.end(), str.begin(), narrow); std::transform(fileName.begin(), fileName.end(), str.begin(), narrow);
FILE* f = fopen(str.c_str(), "r"); FILE* f = fopen(str.c_str(), "r");
@ -179,7 +179,7 @@ static JSValue loadxml(Context *cx, const JSValues &argv)
for (size_t i = 1; i < n; ++i) { for (size_t i = 1; i < n; ++i) {
JSValue val = argv[i].toString(); JSValue val = argv[i].toString();
if (val.isString()) { if (val.isString()) {
JSString& fileName(*val.string); JSString& fileName = *val.string;
std::string str(fileName.length(), char()); std::string str(fileName.length(), char());
std::transform(fileName.begin(), fileName.end(), str.begin(), narrow); std::transform(fileName.begin(), fileName.end(), str.begin(), narrow);
cx->loadClass(str.c_str()); cx->loadClass(str.c_str());