Permalink
Browse files

Clean up tabs and some whitespace

  • Loading branch information...
1 parent 511ae43 commit 05703a990d2154a5a6a7e9493ef153cf8987d9f6 @nicksieger nicksieger committed Jan 28, 2010
Showing with 197 additions and 197 deletions.
  1. +3 −3 argnames.h
  2. +62 −62 argparser.cpp
  3. +4 −4 jrubyexe.cpp
  4. +3 −3 jvmlauncher.h
  5. +2 −2 nbexecloader.h
  6. +88 −88 ng.c
  7. +22 −22 platformlauncher.cpp
  8. +2 −2 platformlauncher.h
  9. +8 −8 unixlauncher.cpp
  10. +3 −3 utilsfuncs.h
View
@@ -1,12 +1,12 @@
-/*
+/*
* File: argnames.h
* Author: Holy
*
* Created on 4. prosinec 2008, 14:13
*/
#ifndef _ARGNAMES_H
-#define _ARGNAMES_H
+#define _ARGNAMES_H
/* Standard Java classpath options */
#define ARG_NAME_CP "-J-cp"
@@ -33,5 +33,5 @@
#define ARG_NAME_NG_SERVER "--ng-server"
#define ARG_NAME_NG "--ng"
-#endif /* _ARGNAMES_H */
+#endif /* _ARGNAMES_H */
View
@@ -119,49 +119,49 @@ bool ArgParser::initPlatformDir() {
#ifdef __MACH__
uint32_t sz = PATH_MAX;
if (_NSGetExecutablePath(path, &sz) == 0) { // OSX-specific
- logMsg("initPlatformDir: using _NSGetExecutablePath");
- string tmpPath(path);
- realpath(tmpPath.c_str(), path);
- found = true;
+ logMsg("initPlatformDir: using _NSGetExecutablePath");
+ string tmpPath(path);
+ realpath(tmpPath.c_str(), path);
+ found = true;
}
#endif
if (!found && platformDir[0] == '/') { // argv[0]: absolute path
- logMsg("initPlatformDir: argv[0] appears to be an absolute path");
- strncpy(path, platformDir.c_str(), PATH_MAX);
- found = true;
+ logMsg("initPlatformDir: argv[0] appears to be an absolute path");
+ strncpy(path, platformDir.c_str(), PATH_MAX);
+ found = true;
}
if (!found && platformDir.find('/') != string::npos) { // argv[0]: relative path
- logMsg("initPlatformDir: argv[0] appears to be a relative path");
- getcwd(path, PATH_MAX - platformDir.length() - 1);
- strncpy(path + strlen(path), platformDir.c_str(), platformDir.length());
- found = true;
- }
-
- if (!found) { // try via PATH search
- logMsg("initPlatformDir: trying to find executable on PATH");
- char * location = findOnPath(platformDir.c_str());
- if (location != NULL) {
- strncpy(path, location, PATH_MAX);
- free(location);
- found = true;
- }
+ logMsg("initPlatformDir: argv[0] appears to be a relative path");
+ getcwd(path, PATH_MAX - platformDir.length() - 1);
+ strncpy(path + strlen(path), platformDir.c_str(), platformDir.length());
+ found = true;
+ }
+
+ if (!found) { // try via PATH search
+ logMsg("initPlatformDir: trying to find executable on PATH");
+ char * location = findOnPath(platformDir.c_str());
+ if (location != NULL) {
+ strncpy(path, location, PATH_MAX);
+ free(location);
+ found = true;
+ }
}
- if (!found) { // try via JRUBY_HOME
- if (getenv("JRUBY_HOME") != NULL) {
- logMsg("initPlatformDir: trying JRUBY_HOME environment variable");
- strncpy(path, getenv("JRUBY_HOME"), PATH_MAX - 11);
- strncpy(path + strlen(path), "/bin/jruby", 10);
- found = true;
- }
+ if (!found) { // try via JRUBY_HOME
+ if (getenv("JRUBY_HOME") != NULL) {
+ logMsg("initPlatformDir: trying JRUBY_HOME environment variable");
+ strncpy(path, getenv("JRUBY_HOME"), PATH_MAX - 11);
+ strncpy(path + strlen(path), "/bin/jruby", 10);
+ found = true;
+ }
}
if (!fileExists(path)) {
- printToConsole("Could not figure out a proper location for JRuby.\n"
- "Try `jruby -Xtrace trace.log ...` and view trace.log for details.");
- return false;
+ printToConsole("Could not figure out a proper location for JRuby.\n"
+ "Try `jruby -Xtrace trace.log ...` and view trace.log for details.");
+ return false;
}
#endif
@@ -182,10 +182,10 @@ bool ArgParser::initPlatformDir() {
}
bool ArgParser::parseArgs(int argc, char *argv[]) {
-#define CHECK_ARG \
- if (i+1 == argc || *argv[i+1] == '-') { \
- logErr(false, true, "Argument is missing for \"%s\" option.", argv[i]); \
- return false; \
+#define CHECK_ARG \
+ if (i+1 == argc || *argv[i+1] == '-') { \
+ logErr(false, true, "Argument is missing for \"%s\" option.", argv[i]); \
+ return false; \
}
addEnvVarToOptions(javaOptions, "JAVA_OPTS");
@@ -206,11 +206,11 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
} else if (strcmp(ARG_NAME_SEPAR_PROC, argv[i]) == 0) {
separateProcess = true;
logMsg("Run Java in separater process");
- } else if (strcmp(ARG_NAME_CMD_ONLY, argv[i]) == 0) {
- printCommandLine = true;
+ } else if (strcmp(ARG_NAME_CMD_ONLY, argv[i]) == 0) {
+ printCommandLine = true;
} else if (strcmp(ARG_NAME_LAUNCHER_LOG, argv[i]) == 0) {
- CHECK_ARG;
- i++;
+ CHECK_ARG;
+ i++;
} else if (strcmp(ARG_NAME_BOOTCLASS, argv[i]) == 0) {
CHECK_ARG;
bootclass = argv[++i];
@@ -301,7 +301,7 @@ void ArgParser::prepareOptions() {
#else
const char* shell = getenv("SHELL");
if (shell == NULL) {
- shell = "/bin/sh";
+ shell = "/bin/sh";
}
option += shell;
#endif
@@ -314,22 +314,22 @@ void ArgParser::prepareOptions() {
#else
struct utsname name;
if (uname(&name) == 0) {
- string ffiPath, ffiBase(platformDir + "/lib/native");
- DIR* dir = opendir(ffiBase.c_str());
- struct dirent* ent;
- if (dir != NULL) {
- while ((ent = readdir(dir)) != NULL) {
- string entry(ent->d_name);
- if (entry.find(name.sysname) != string::npos) {
- if (!ffiPath.empty()) {
- ffiPath += PATH_SEP;
- }
- ffiPath += ffiBase + FILE_SEP + entry;
- }
- }
- closedir(dir);
- }
- option += ffiPath;
+ string ffiPath, ffiBase(platformDir + "/lib/native");
+ DIR* dir = opendir(ffiBase.c_str());
+ struct dirent* ent;
+ if (dir != NULL) {
+ while ((ent = readdir(dir)) != NULL) {
+ string entry(ent->d_name);
+ if (entry.find(name.sysname) != string::npos) {
+ if (!ffiPath.empty()) {
+ ffiPath += PATH_SEP;
+ }
+ ffiPath += ffiBase + FILE_SEP + entry;
+ }
+ }
+ closedir(dir);
+ }
+ option += ffiPath;
}
#endif
javaOptions.push_back(option);
@@ -340,7 +340,7 @@ void ArgParser::prepareOptions() {
constructClassPath();
if (bootclass.empty()) {
- bootclass = MAIN_CLASS;
+ bootclass = MAIN_CLASS;
}
// replace '/' by '.' to report a better name to jps/jconsole
@@ -464,11 +464,11 @@ void ArgParser::addJarsToClassPathFrom(const char *dir) {
struct dirent *ent;
while((ent = readdir(directory)) != NULL) {
- int len = strlen(ent->d_name);
- if (len > 4 && strncmp(".jar", (ent->d_name + (len - 4)), 4) == 0) {
- string fullName = path + FILE_SEP + ent->d_name;
- addToClassPath(fullName.c_str());
- }
+ int len = strlen(ent->d_name);
+ if (len > 4 && strncmp(".jar", (ent->d_name + (len - 4)), 4) == 0) {
+ string fullName = path + FILE_SEP + ent->d_name;
+ addToClassPath(fullName.c_str());
+ }
}
closedir(directory);
#endif
View
@@ -50,10 +50,10 @@ const char *CON_ATTACH_MSG =
"*WARNING*: The non-console JRubyW launcher is forced to attach to console.\n"
"This may cause unexpected behavior of CMD console. Use:\n"
" start /wait jrubyw.exe -Xconsole attach [args]\n";
-#endif // JRUBYW
+#endif // JRUBYW
#else
#include "unixlauncher.h"
-#endif // WIN32
+#endif // WIN32
#include "utilsfuncs.h"
@@ -72,13 +72,13 @@ int main(int argc, char *argv[], char* envp[]) {
} else {
logMsg("Console is not attached, assume CONSOLE mode");
}
-#endif // JRUBYW
+#endif // JRUBYW
NBExecLoader loader;
return loader.start("jruby.dll", argc - 1, argv + 1, argv[0]);
#else // !WIN32
UnixLauncher launcher;
return launcher.run(argc, argv, envp);
-#endif // WIN32
+#endif // WIN32
}
View
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
- * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2008, 2010 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
@@ -42,7 +42,7 @@
*/
#ifndef _JVMLAUNCHER_H
-#define _JVMLAUNCHER_H
+#define _JVMLAUNCHER_H
#include <windows.h>
#include <string>
@@ -137,5 +137,5 @@ class JvmLauncher {
};
};
-#endif /* _JVMLAUNCHER_H */
+#endif /* _JVMLAUNCHER_H */
View
@@ -1,5 +1,5 @@
#ifndef _NBEXECLOADER_H
-#define _NBEXECLOADER_H
+#define _NBEXECLOADER_H
#include "utilsfuncs.h"
@@ -39,5 +39,5 @@ class NBExecLoader {
HMODULE hLib;
};
-#endif /* _NBEXECLOADER_H */
+#endif /* _NBEXECLOADER_H */
Oops, something went wrong.

0 comments on commit 05703a9

Please sign in to comment.