Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jK committed Jul 9, 2012
2 parents 2e19bd8 + 7f4a565 commit c5d0f80
Show file tree
Hide file tree
Showing 787 changed files with 42,361 additions and 15,636 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "tools/unitsync/python"]
path = tools/unitsync/python
url = git://github.com/spring/pyunitsync.git
[submodule "tools/pr-downloader"]
path = tools/pr-downloader
url = git://github.com/abma/pr-downloader.git
50 changes: 26 additions & 24 deletions AI/Interfaces/Java/src/main/native/JavaBridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,31 +355,33 @@ static jobject java_createAIClassLoader(JNIEnv* env,
java_createAIClassPath(shortName, version, classPathParts, classPathParts_sizeMax);

jobjectArray o_cppURLs = jniUtil_createURLArray(env, classPathParts_size);
if (o_cppURLs == NULL) { return NULL; }
size_t cpp;
for (cpp = 0; cpp < classPathParts_size; ++cpp) {
#ifdef _WIN32
// we can not use windows path separators in file URLs
util_strReplaceChar(classPathParts[cpp], '\\', '/');
#endif

char* str_fileUrl = util_allocStrCat(2, FILE_URL_PREFIX, classPathParts[cpp]);
simpleLog_logL(SIMPLELOG_LEVEL_FINE,
"Skirmish AI %s %s class-path part %i: %s",
shortName, version, cpp, str_fileUrl);
jobject jurl_fileUrl = jniUtil_createURLObject(env, str_fileUrl);
if (jurl_fileUrl == NULL) { return NULL; }
const bool inserted = jniUtil_insertURLIntoArray(env, o_cppURLs, cpp, jurl_fileUrl);
if (!inserted) { return NULL; }

// TODO: check/test if this is allowed/ok
FREE(str_fileUrl);
FREE(classPathParts[cpp]);
}
if (o_cppURLs != NULL) {
size_t cpp;
for (cpp = 0; cpp < classPathParts_size; ++cpp) {
#ifdef _WIN32
// we can not use windows path separators in file URLs
util_strReplaceChar(classPathParts[cpp], '\\', '/');
#endif

char* str_fileUrl = util_allocStrCat(2, FILE_URL_PREFIX, classPathParts[cpp]);
simpleLog_logL(SIMPLELOG_LEVEL_FINE,
"Skirmish AI %s %s class-path part %i: %s",
shortName, version, cpp, str_fileUrl);
jobject jurl_fileUrl = jniUtil_createURLObject(env, str_fileUrl);
if (jurl_fileUrl == NULL) { return NULL; }
const bool inserted = jniUtil_insertURLIntoArray(env, o_cppURLs, cpp, jurl_fileUrl);
if (!inserted) { return NULL; }

// TODO: check/test if this is allowed/ok
FREE(str_fileUrl);
FREE(classPathParts[cpp]);
}

o_jClsLoader = jniUtil_createURLClassLoader(env, o_cppURLs);
if (o_jClsLoader == NULL) { return NULL; }
o_jClsLoader = jniUtil_makeGlobalRef(env, o_jClsLoader, "Skirmish AI class-loader");
o_jClsLoader = jniUtil_createURLClassLoader(env, o_cppURLs);
if (o_jClsLoader != NULL) {
o_jClsLoader = jniUtil_makeGlobalRef(env, o_jClsLoader, "Skirmish AI class-loader");
}
}

FREE(classPathParts);

Expand Down
6 changes: 6 additions & 0 deletions AI/Interfaces/Java/src/main/native/JniUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ const char* jniUtil_getJniRetValDescription(const jint retVal) {
case JNI_ERR: { return "JNI_ERR - unknown error"; break; }
case JNI_EDETACHED: { return "JNI_EDETACHED - thread detached from the VM"; break; }
case JNI_EVERSION: { return "JNI_EVERSION - JNI version error"; break; }
#ifdef JNI_ENOMEM
case JNI_ENOMEM: { return "JNI_ENOMEM - not enough (contiguous) memory"; break; }
#endif // JNI_ENOMEM
#ifdef JNI_EEXIST
case JNI_EEXIST: { return "JNI_EEXIST - VM already created"; break; }
#endif // JNI_EEXIST
#ifdef JNI_EINVAL
case JNI_EINVAL: { return "JNI_EINVAL - invalid arguments"; break; }
#endif // JNI_EINVAL
default: { return "UNKNOWN - unknown/invalid JNI return value"; break; }
}
}
Expand Down
1 change: 1 addition & 0 deletions AI/Skirmish/AAI/AAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ AAI::~AAI()

initialized = false;
fclose(file);
file = NULL;
}


Expand Down
2 changes: 1 addition & 1 deletion AI/Skirmish/E323AI
Submodule E323AI updated 1 files
+1 −1 Util.cpp
2 changes: 1 addition & 1 deletion AI/Skirmish/RAI/BasicArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct basicArray

basicArrayType *elementList;
int elementIndex; // essentially a built-in iterator
int size() { return elementSize; };
int size() const { return elementSize; };
int elementSize; // the amount of elements in use
};

Expand Down
2 changes: 1 addition & 1 deletion AI/Skirmish/RAI/BuilderPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void cBuilderPlacement::EResourceEnterLOS(int enemy, EnemyInfo *E)
}
}

bool cBuilderPlacement::NeedResourceSite(const UnitDef* bd)
bool cBuilderPlacement::NeedResourceSite(const UnitDef* bd) const
{
if( !bd->needGeo && bd->extractsMetal==0 )
return false;
Expand Down
2 changes: 1 addition & 1 deletion AI/Skirmish/RAI/BuilderPlacement.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class cBuilderPlacement
void UResourceDestroyed(int unit, UnitInfo *U);
void EResourceEnterLOS(int enemy, EnemyInfo *E);

bool NeedResourceSite(const UnitDef* bd);
bool NeedResourceSite(const UnitDef* bd) const;
ResourceSiteExt* FindResourceSite(float3& pos, const UnitDef* bd, TerrainMapArea* BuilderMA); // called when a builder has been assigned
float3 FindBuildPosition(sBuildQuarry *BQ);
void CheckBlockedRList( map<int,ResourceSiteExt*> *RL = 0 ); // CheckBlocked for all resource sites on this list
Expand Down
3 changes: 2 additions & 1 deletion AI/Skirmish/RAI/GResourceMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ GlobalResourceMap::~GlobalResourceMap()
{
FILE* resourceFile_w = NULL;
if (resourceFileName_w.empty()) {
throw 12;
*l<< "Error: resourceFileName_w is empty!";
return;
} else {
resourceFile_w = fopen(resourceFileName_w.c_str(), "wb");
}
Expand Down
6 changes: 3 additions & 3 deletions AI/Wrappers/CUtils/bin/commonOOCallback.awk
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ function part_getIndicesArgs(clsName_p, implClsName_p, params_p, metaComment_p,
#if (clsName_p == "MoveData") { print("parentImplClsId_p: #" parentImplClsId_p "#" cls_implId_indicesArgs[parentImplClsId_p] "#"); }
indicesArgs_p = cls_implId_indicesArgs[parentImplClsId_p];
} else {
print("warning: possible problem with indices args of " implClsName_p);
#print("XXX: " clsName_p " / " implClsName_p ": " params_p);

print("caution: possible problem with indices args of " implClsName_p);
# This is very hacky! may very well breack in the future.
# use only first param, if there is one
indicesArgs_p = params_p;
Expand Down Expand Up @@ -815,7 +815,7 @@ function wrappFunctionPlusMeta(retType, fullName, params, metaComment) {

size_funcs++;
} else {
print("warning: function intentionally NOT wrapped: " fullName);
print("note: function intentionally NOT wrapped: " fullName);
}
}

Expand Down
Loading

0 comments on commit c5d0f80

Please sign in to comment.