You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/06/12 02:28:53 UTC
[lucy-commits] svn commit: r1134844 - in
/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core: Compiler.c
Compiler.h Dir.c OperatingSystem.c OperatingSystem.h
Author: marvin
Date: Sun Jun 12 00:28:52 2011
New Revision: 1134844
URL: http://svn.apache.org/viewvc?rev=1134844&view=rev
Log:
LUCY-156 Const-ify some arguments.
Convert some "char*" arguments "const char*".
Modified:
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.h
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c?rev=1134844&r1=1134843&r2=1134844&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c Sun Jun 12 00:28:52 2011
@@ -210,7 +210,7 @@ CC_compile_obj(const char *source_path,
}
chaz_bool_t
-CC_test_compile(char *source, size_t source_len) {
+CC_test_compile(const char *source, size_t source_len) {
chaz_bool_t compile_succeeded;
if (!Util_remove_and_verify(try_app_name)) {
@@ -226,7 +226,7 @@ CC_test_compile(char *source, size_t sou
}
char*
-CC_capture_output(char *source, size_t source_len, size_t *output_len) {
+CC_capture_output(const char *source, size_t source_len, size_t *output_len) {
char *captured_output = NULL;
chaz_bool_t compile_succeeded;
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h?rev=1134844&r1=1134843&r2=1134844&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h Sun Jun 12 00:28:52 2011
@@ -45,7 +45,7 @@ chaz_CC_compile_obj(const char *source_p
* effort succeeds.
*/
chaz_bool_t
-chaz_CC_test_compile(char *source, size_t source_len);
+chaz_CC_test_compile(const char *source, size_t source_len);
/* Attempt to compile the supplied source code. If successful, capture the
* output of the program and return a pointer to a newly allocated buffer.
@@ -53,7 +53,8 @@ chaz_CC_test_compile(char *source, size_
* output will be placed into the integer pointed to by [output_len].
*/
char*
-chaz_CC_capture_output(char *source, size_t source_len, size_t *output_len);
+chaz_CC_capture_output(const char *source, size_t source_len,
+ size_t *output_len);
/* Add an include directory which will be used for all future compilation
* attempts.
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c?rev=1134844&r1=1134843&r2=1134844&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c Sun Jun 12 00:28:52 2011
@@ -62,7 +62,7 @@ static char rmdir_code[] =
QUOTE( } );
static chaz_bool_t
-S_try_init_posix_mkdir(char *header) {
+S_try_init_posix_mkdir(const char *header) {
size_t needed = sizeof(posix_mkdir_code) + 30;
char *code_buf = (char*)malloc(needed);
@@ -112,7 +112,7 @@ S_init_mkdir(void) {
}
static chaz_bool_t
-S_try_init_rmdir(char *header) {
+S_try_init_rmdir(const char *header) {
size_t needed = sizeof(posix_mkdir_code) + 30;
char *code_buf = (char*)malloc(needed);
sprintf(code_buf, rmdir_code, header);
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c?rev=1134844&r1=1134843&r2=1134844&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.c Sun Jun 12 00:28:52 2011
@@ -164,7 +164,7 @@ S_build_charm_run(void) {
}
void
-OS_remove_exe(char *name) {
+OS_remove_exe(const char *name) {
char *exe_name = (char*)malloc(strlen(name) + strlen(exe_ext) + 1);
sprintf(exe_name, "%s%s", name, exe_ext);
remove(exe_name);
@@ -172,7 +172,7 @@ OS_remove_exe(char *name) {
}
void
-OS_remove_obj(char *name) {
+OS_remove_obj(const char *name) {
char *obj_name = (char*)malloc(strlen(name) + strlen(obj_ext) + 1);
sprintf(obj_name, "%s%s", name, obj_ext);
remove(obj_name);
@@ -180,7 +180,7 @@ OS_remove_obj(char *name) {
}
int
-OS_run_local(char *arg1, ...) {
+OS_run_local(const char *arg1, ...) {
va_list args;
size_t len = strlen(local_command_start) + strlen(arg1);
char *command = (char*)malloc(len + 1);
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.h?rev=1134844&r1=1134843&r2=1134844&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.h (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/OperatingSystem.h Sun Jun 12 00:28:52 2011
@@ -28,18 +28,18 @@ extern "C" {
/* Remove an executable file named [name], appending the exe_ext if needed.
*/
void
-chaz_OS_remove_exe(char *name);
+chaz_OS_remove_exe(const char *name);
/* Remove an object file named [name], appending the obj_ext if needed.
*/
void
-chaz_OS_remove_obj(char *name);
+chaz_OS_remove_obj(const char *name);
/* Concatenate all arguments in a NULL-terminated list into a single command
* string, prepend the appropriate prefix, and invoke via system().
*/
int
-chaz_OS_run_local(char *arg1, ...);
+chaz_OS_run_local(const char *arg1, ...);
/* Invoke a command and attempt to suppress output from both stdout and stderr
* (as if they had been sent to /dev/null). If it's not possible to run the