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 2009/12/12 22:33:56 UTC
svn commit: r889983 - in /lucene/lucy/trunk/charmonizer: ./ src/Charmonizer/
src/Charmonizer/Core/ src/Charmonizer/Test/
Author: marvin
Date: Sat Dec 12 21:33:55 2009
New Revision: 889983
URL: http://svn.apache.org/viewvc?rev=889983&view=rev
Log:
Change commenting style for most files within trunk/charmonizer to prefer
initial capitalization and terminating period, consistent with the rest of
Lucy.
Modified:
lucene/lucy/trunk/charmonizer/charmonize.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestHeaders.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestIntegers.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestLargeFiles.c
Modified: lucene/lucy/trunk/charmonizer/charmonize.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/charmonize.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/charmonize.c (original)
+++ lucene/lucy/trunk/charmonizer/charmonize.c Sat Dec 12 21:33:55 2009
@@ -1,4 +1,4 @@
-/* charmonize.c -- Create Charmony.
+/* Charmonize.c -- Create Charmony.
*/
#include <stdio.h>
@@ -51,7 +51,7 @@
{
init(argc, argv);
- /* modules section */
+ /* Modules section. */
chaz_DirManip_run();
chaz_Headers_run();
chaz_FuncMacro_run();
@@ -61,10 +61,10 @@
chaz_UnusedVars_run();
chaz_VariadicMacros_run();
- /* write custom postamble */
+ /* Write custom postamble. */
S_write_charmony_postamble();
- /* clean up */
+ /* Clean up. */
chaz_Probe_clean_up();
free(cc_command);
free(cc_flags);
@@ -80,7 +80,7 @@
char *infile_str;
size_t infile_len;
- /* parse the infile */
+ /* Parse the infile. */
if (argc != 2)
die("Usage: ./charmonize INFILE");
infile_str = chaz_Probe_slurp_file(argv[1], &infile_len);
@@ -92,14 +92,14 @@
"charm_os_name");
verbosity_str = S_extract_delim(infile_str, infile_len, "charm_verbosity");
- /* set up Charmonizer */
+ /* Set up Charmonizer. */
if (verbosity_str != NULL) {
const long verbosity = strtol(verbosity_str, NULL, 10);
chaz_Probe_set_verbosity(verbosity);
}
chaz_Probe_init(os_name, cc_command, cc_flags, NULL);
- /* clean up */
+ /* Clean up. */
free(infile_str);
}
@@ -115,13 +115,13 @@
char *start, *end;
char *retval = NULL;
- /* sanity check, then create delimiter strings to match against */
+ /* Sanity check, then create delimiter strings to match against. */
if (tag_name_len > 95)
die("tag name too long: '%s'");
sprintf(opening_delim, "<%s>", tag_name);
sprintf(closing_delim, "</%s>", tag_name);
- /* find opening <delimiter> */
+ /* Find opening <delimiter>. */
for (start = source; start < limit; start++) {
if (strncmp(start, opening_delim, opening_delim_len) == 0) {
start += opening_delim_len;
@@ -129,7 +129,7 @@
}
}
- /* find closing </delimiter> */
+ /* Find closing </delimiter>. */
for (end = start; end < limit; end++) {
if (strncmp(end, closing_delim, closing_delim_len) == 0) {
const size_t retval_len = end - start;
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c Sat Dec 12 21:33:55 2009
@@ -34,27 +34,27 @@
if (Util_verbosity)
printf("Creating compiler object...\n");
- /* assign */
+ /* Assign. */
self->os = oper_sys;
self->cc_command = strdup(cc_command);
self->cc_flags = strdup(cc_flags);
- /* init */
+ /* Init. */
self->compile_exe = S_compile_exe;
self->compile_obj = S_compile_obj;
self->add_inc_dir = S_add_inc_dir;
self->destroy = S_destroy;
self->inc_dirs = (char**)calloc(sizeof(char*), 1);
- /* set compiler-specific vars */
+ /* Set compiler-specific vars. */
self->include_flag = strdup(compiler_spec->include_flag);
self->object_flag = strdup(compiler_spec->object_flag);
self->exe_flag = strdup(compiler_spec->exe_flag);
- /* add the current directory as an include dir */
+ /* Add the current directory as an include dir. */
self->add_inc_dir(self, ".");
- /* if we can't compile anything, game over */
+ /* If we can't compile anything, game over. */
S_do_test_compile(self);
return self;
@@ -209,13 +209,13 @@
if (Util_verbosity)
printf("Trying to compile a small test file...\n");
- /* attempt compilation */
+ /* Attempt compilation. */
success = self->compile_exe(self, "_charm_try.c",
"_charm_try", code, strlen(code));
if (!success)
Util_die("Failed to compile a small test file");
- /* clean up */
+ /* Clean up. */
remove("_charm_try.c");
self->os->remove_exe(self->os, "_charm_try");
}
@@ -226,12 +226,12 @@
size_t num_dirs = 0;
char **dirs = self->inc_dirs;
- /* count up the present number of dirs, reallocate */
+ /* Count up the present number of dirs, reallocate. */
while (*dirs++ != NULL) { num_dirs++; }
- num_dirs += 1; /* passed-in dir */
+ num_dirs += 1; /* Passed-in dir. */
self->inc_dirs = (char**)realloc(self->inc_dirs, (num_dirs + 1)*sizeof(char*));
- /* put the passed-in dir at the end of the list */
+ /* Put the passed-in dir at the end of the list. */
self->inc_dirs[num_dirs - 1] = strdup(dir);
self->inc_dirs[num_dirs] = NULL;
}
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.c Sat Dec 12 21:33:55 2009
@@ -4,7 +4,7 @@
#include "Charmonizer/Core/Util.h"
#include "Charmonizer/Core/CompilerSpec.h"
-/* detect a supported compiler */
+/* Detect a supported compiler. */
#ifdef __GNUC__
static CompilerSpec spec = { "gcc", "-I ", "-o ", "-o " };
#elif defined(_MSC_VER)
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c Sat Dec 12 21:33:55 2009
@@ -11,7 +11,7 @@
chaz_bool_t exists;
} Header;
-/* hello_world.c without the hello or the world */
+/* "hello_world.c" without the hello or the world. */
static char test_code[] = "int main() { return 0; }\n";
/* Keep a sorted, dynamically-sized array of names of all headers we've
@@ -47,7 +47,7 @@
{
Header *null_header = (Header*)malloc(sizeof(Header));
- /* create terminating record for the dynamic array of Header objects */
+ /* Create terminating record for the dynamic array of Header objects. */
null_header->name = NULL;
null_header->exists = false;
header_cache = (Header**)malloc(sizeof(void*));
@@ -63,13 +63,13 @@
Header *fake = &key;
Header **header_ptr;
- /* fake up a key to feed to bsearch; see if the header's already there */
+ /* Fake up a key to feed to bsearch; see if the header's already there. */
key.name = (char*)header_name;
key.exists = false;
header_ptr = (Header**)bsearch(&fake, header_cache, cache_size,
sizeof(void*), S_compare_headers);
- /* if it's not there, go try a test compile */
+ /* If it's not there, go try a test compile. */
if (header_ptr == NULL) {
header = S_discover_header(header_name);
S_add_to_cache(header);
@@ -89,7 +89,7 @@
char *code_buf = strdup("");
size_t needed = sizeof(test_code) + 20;
- /* build the source code string */
+ /* Build the source code string. */
for (i = 0; header_names[i] != NULL; i++) {
needed += strlen(header_names[i]);
needed += sizeof("#include <>\n");
@@ -103,7 +103,7 @@
}
strcat(code_buf, test_code);
- /* if the code compiles, bulk add all header names to the cache */
+ /* If the code compiles, bulk add all header names to the cache. */
success = ModHand_test_compile(code_buf, strlen(code_buf));
if (success) {
for (i = 0; header_names[i] != NULL; i++) {
@@ -140,7 +140,7 @@
Header **const a = (Header**)vptr_a;
Header **const b = (Header**)vptr_b;
- if ((*a)->name == NULL) /* null is "greater than" any string */
+ if ((*a)->name == NULL) /* NULL is "greater than" any string. */
return 1;
else if ((*b)->name == NULL)
return -1;
@@ -155,10 +155,10 @@
size_t needed = strlen(header_name) + sizeof(test_code) + 50;
char *include_test = (char*)malloc(needed);
- /* assign */
+ /* Assign. */
header->name = strdup(header_name);
- /* see whether code that tries to pull in this header compiles */
+ /* See whether code that tries to pull in this header compiles. */
sprintf(include_test, "#include <%s>\n%s", header_name, test_code);
header->exists = ModHand_test_compile(include_test, strlen(include_test));
@@ -169,12 +169,12 @@
static void
S_add_to_cache(Header *header)
{
- /* realloc array -- inefficient, but this isn't a bottleneck */
+ /* Realloc array -- inefficient, but this isn't a bottleneck. */
cache_size++;
header_cache = (Header**)realloc(header_cache, (cache_size * sizeof(void*)));
header_cache[ cache_size - 1 ] = header;
- /* keep the list of headers sorted */
+ /* Keep the list of headers sorted. */
qsort(header_cache, cache_size, sizeof(*header_cache), S_compare_headers);
}
@@ -185,13 +185,13 @@
Header key;
Header *fake = &key;
- /* fake up a key and bsearch for it */
+ /* Fake up a key and bsearch for it. */
key.name = (char*)header_name;
key.exists = exists;
header = (Header*)bsearch(&fake, header_cache, cache_size,
sizeof(void*), S_compare_headers);
- /* we've already done the test compile, so skip that step and add it */
+ /* We've already done the test compile, so skip that step and add it. */
if (header == NULL) {
header = (Header*)malloc(sizeof(Header));
header->name = strdup(header_name);
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c Sat Dec 12 21:33:55 2009
@@ -26,30 +26,30 @@
static void
S_clean_up_try();
-/* global vars */
+/* Global vars. */
struct OperSys *ModHand_os = NULL;
struct Compiler *ModHand_compiler = NULL;
chaz_bool_t chaz_ModHand_charm_run_available = false;
FILE* ModHand_charmony_fh = NULL;
-/* static vars */
+/* Static vars. */
static char *try_app_path = NULL;
static char *try_app_command = NULL;
void
ModHand_init()
{
- /* set the name of the application which we "try" to execute */
+ /* Set the name of the application which we "try" to execute. */
size_t len = strlen(TRY_APP_BASENAME) + strlen(ModHand_os->exe_ext) + 1;
try_app_path = (char*)malloc(len);
sprintf(try_app_path, "%s%s", TRY_APP_BASENAME, ModHand_os->exe_ext);
- /* set the invocation string for the "try" application */
+ /* Set the invocation string for the "try" application. */
len = strlen(ModHand_os->local_command_start) + strlen(try_app_path) + 1;
try_app_command = (char*)malloc(len);
sprintf(try_app_command, "%s%s", ModHand_os->local_command_start, try_app_path);
- /* write files needed by this module and others */
+ /* Write files needed by this module and others. */
S_build_charm_run();
S_write_charm_h();
}
@@ -57,12 +57,12 @@
void
ModHand_open_charmony_h(const char *charmony_start)
{
- /* open the filehandle */
+ /* Open the filehandle. */
ModHand_charmony_fh = fopen("charmony.h", "w+");
if (ModHand_charmony_fh == NULL)
Util_die("Can't open 'charmony.h': %s", strerror(errno));
- /* print supplied text (if any) along with warning, open include guard */
+ /* Print supplied text (if any) along with warning, open include guard. */
if (charmony_start != NULL)
fprintf(ModHand_charmony_fh, charmony_start);
fprintf(ModHand_charmony_fh,
@@ -77,12 +77,12 @@
void
ModHand_clean_up(void)
{
- /* clean up some temp files */
+ /* Clean up some temp files. */
remove("_charm.h");
ModHand_os->remove_exe(ModHand_os, "_charm_run");
ModHand_os->remove_exe(ModHand_os, "_charm_stat");
- /* write the last bit of charmony.h and close */
+ /* Write the last bit of charmony.h and close. */
fprintf(ModHand_charmony_fh, "#endif /* H_CHARMONY */\n\n");
if (fclose(ModHand_charmony_fh))
Util_die("Couldn't close 'charmony.h': %s", strerror(errno));
@@ -114,11 +114,11 @@
int main(int argc, char **argv)
{
char *command;
- size_t command_len = 1; /* terminating null */
+ size_t command_len = 1; /* Terminating null. */
int i;
int retval;
- /* rebuild the command line args, minus the name of this utility */
+ /* Rebuild the command line args, minus the name of this utility. */
for (i = 1; i < argc; i++) {
command_len += strlen(argv[i]) + 1;
}
@@ -134,7 +134,7 @@
strcat( strcat(command, " "), argv[i] );
}
- /* redirect stdout and stderr to /dev/null or equivalent */
+ /* Redirect stdout and stderr to /dev/null or equivalent. */
freopen(
METAQUOTE;
@@ -146,7 +146,7 @@
static char charm_run_code_d[] = METAQUOTE
, "w", stderr);
- /* run the commmand and return its value to the parent process */
+ /* Run the commmand and return its value to the parent process. */
retval = system(command);
free(command);
return retval;
@@ -206,13 +206,13 @@
char *captured_output = NULL;
chaz_bool_t compile_succeeded;
- /* clear out previous versions and test to make sure removal worked */
+ /* Clear out previous versions and test to make sure removal worked. */
if ( !Util_remove_and_verify(try_app_path) )
Util_die("Failed to delete file '%s'", try_app_path);
if ( !Util_remove_and_verify(TARGET_PATH) )
Util_die("Failed to delete file '%s'", TARGET_PATH);
- /* attempt compilation; if successful, run app and slurp output */
+ /* Attempt compilation; if successful, run app and slurp output. */
compile_succeeded = ModHand_compiler->compile_exe(ModHand_compiler,
TRY_SOURCE_PATH, TRY_APP_BASENAME, source, source_len);
if (compile_succeeded) {
@@ -223,7 +223,7 @@
*output_len = 0;
}
- /* remove all the files we just created */
+ /* Remove all the files we just created. */
S_clean_up_try();
return captured_output;
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c Sat Dec 12 21:33:55 2009
@@ -30,10 +30,10 @@
if (Util_verbosity)
printf("Creating os object...\n");
- /* assign */
+ /* Assign. */
self->name = strdup(name);
- /* init */
+ /* Init. */
self->buf = NULL;
self->buf_len = 0;
self->remove_obj = S_remove_obj;
@@ -41,7 +41,7 @@
self->run_local = S_run_local;
self->destroy = S_destroy;
- /* derive */
+ /* Derive. */
if (strcmp(name, "mswin32") == 0) {
self->obj_ext = strdup(".obj");
self->exe_ext = strdup(".exe");
@@ -71,7 +71,7 @@
if (Util_verbosity)
printf("Trying to find a bit-bucket a la /dev/null...\n");
- /* iterate through names of possible devnulls trying to open them */
+ /* Iterate through names of possible devnulls trying to open them. */
for (i = 0; devnull_options[i] != NULL; i++) {
if (Util_can_open_file(devnull_options[i])) {
self->devnull = strdup(devnull_options[i]);
@@ -79,7 +79,7 @@
}
}
- /* bail out we couldn't find a devnull */
+ /* Bail out we couldn't find a devnull. */
Util_die("Couldn't find anything like /dev/null");
}
@@ -122,7 +122,7 @@
int retval;
char *arg;
- /* append all supplied texts */
+ /* Append all supplied texts. */
va_start(args, self);
while (NULL != (arg = va_arg(args, char*))) {
len += strlen(arg);
@@ -131,7 +131,7 @@
}
va_end(args);
- /* run the command */
+ /* Run the command. */
retval = system(command);
free(command);
return retval;
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c Sat Dec 12 21:33:55 2009
@@ -14,7 +14,7 @@
static chaz_bool_t initialized = false;
static chaz_bool_t stat_available = false;
-/* lazily compile _charm_stat */
+/* Lazily compile _charm_stat. */
static void
S_init();
@@ -24,24 +24,24 @@
char *stat_output;
size_t output_len;
- /* failsafe */
+ /* Failsafe. */
target->valid = false;
- /* lazy init */
+ /* Lazy init. */
if (!initialized)
S_init();
- /* bail out if we didn't succeed in compiling/using _charm_stat */
+ /* Bail out if we didn't succeed in compiling/using _charm_stat. */
if (!stat_available)
return;
- /* run _charm_stat */
+ /* Run _charm_stat. */
Util_remove_and_verify("_charm_statout");
ModHand_os->run_local(ModHand_os, "_charm_stat ", filepath, NULL);
stat_output = Util_slurp_file("_charm_statout", &output_len);
Util_remove_and_verify("_charm_statout");
- /* parse the output of _charm_stat and store vars in Stat struct */
+ /* Parse the output of _charm_stat and store vars in Stat struct. */
if (stat_output != NULL) {
char *end_ptr = stat_output;
target->size = strtol(stat_output, &end_ptr, 10);
@@ -53,7 +53,7 @@
return;
}
-/* source code for the _charm_stat utility */
+/* Source code for the _charm_stat utility. */
static char charm_stat_code[] = METAQUOTE
#include <stdio.h>
#include <sys/stat.h>
@@ -72,16 +72,16 @@
static void
S_init()
{
- /* only try this once */
+ /* Only try this once. */
initialized = true;
if (Util_verbosity)
printf("Attempting to compile _charm_stat utility...\n");
- /* bail if sys/stat.h isn't available */
+ /* Bail if sys/stat.h isn't available. */
if (!HeadCheck_check_header("sys/stat.h"))
return;
- /* if the compile succeeds, open up for business */
+ /* If the compile succeeds, open up for business. */
stat_available = ModHand_compiler->compile_exe(ModHand_compiler,
"_charm_stat.c", "_charm_stat", charm_stat_code, strlen(charm_stat_code));
remove("_charm_stat.c");
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.c Sat Dec 12 21:33:55 2009
@@ -6,7 +6,7 @@
#include <string.h>
#include "Charmonizer/Core/Util.h"
-/* global verbosity setting */
+/* Global verbosity setting. */
int Util_verbosity = 1;
void
@@ -29,33 +29,33 @@
size_t len;
long check_val;
- /* sanity check */
+ /* Sanity check. */
if (file == NULL)
Util_die("Error opening file '%s': %s", file_path, strerror(errno));
- /* find length; return NULL if the file has a zero-length */
+ /* Find length; return NULL if the file has a zero-length. */
len = Util_flength(file);
if (len == 0) {
*len_ptr = 0;
return NULL;
}
- /* allocate memory and read the file */
+ /* Allocate memory and read the file. */
contents = (char*)malloc(len * sizeof(char) + 1);
if (contents == NULL)
Util_die("Out of memory at %d, %s", __FILE__, __LINE__);
contents[len] = '\0';
check_val = fread(contents, sizeof(char), len, file);
- /* weak error check, because CRLF might result in fewer chars read */
+ /* Weak error check, because CRLF might result in fewer chars read. */
if (check_val <= 0)
Util_die("Tried to read %d characters of '%s', got %d", (int)len,
file_path, check_val);
- /* set length pointer for benefit of caller */
+ /* Set length pointer for benefit of caller. */
*len_ptr = check_val;
- /* clean up */
+ /* Clean up. */
if (fclose(file))
Util_die("Error closing file '%s': %s", file_path, strerror(errno));
@@ -69,7 +69,7 @@
long check_val;
long len;
- /* seek to end of file and check length */
+ /* Seek to end of file and check length. */
check_val = fseek(f, 0, SEEK_END);
if (check_val == -1)
Util_die("fseek error : %s\n", strerror(errno));
@@ -77,7 +77,7 @@
if (len == -1)
Util_die("ftell error : %s\n", strerror(errno));
- /* return to where we were */
+ /* Return to where we were. */
check_val = fseek(f, bookmark, SEEK_SET);
if (check_val == -1)
Util_die("fseek error : %s\n", strerror(errno));
@@ -109,10 +109,10 @@
int
Util_remove_and_verify(char *file_path)
{
- /* try to remove the file */
+ /* Try to remove the file. */
remove(file_path);
- /* return what *might* be success or failure */
+ /* Return what *might* be success or failure. */
return Util_can_open_file(file_path) ? 0 : 1;
}
@@ -121,7 +121,7 @@
{
FILE *garbage_fh;
- /* use fopen as a portable test for the existence of a file */
+ /* Use fopen as a portable test for the existence of a file. */
garbage_fh = fopen(file_path, "r");
if (garbage_fh == NULL) {
return 0;
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.c Sat Dec 12 21:33:55 2009
@@ -14,11 +14,11 @@
Probe_init(const char *osname, const char *cc_command,
const char *cc_flags, const char *charmony_start)
{
- /* create os and compiler objects */
+ /* Create os and compiler objects. */
ModHand_os = OS_new(osname);
ModHand_compiler = CC_new(ModHand_os, cc_command, cc_flags);
- /* dispatch other tasks */
+ /* Dispatch other tasks. */
ModHand_init();
HeadCheck_init();
ModHand_open_charmony_h(charmony_start);
@@ -33,7 +33,7 @@
if (Util_verbosity)
printf("Cleaning up...\n");
- /* dispatch ModHandler's clean up routines, destroy objects */
+ /* Dispatch ModHandler's clean up routines, destroy objects. */
ModHand_clean_up();
ModHand_os->destroy(ModHand_os);
ModHand_compiler->destroy(ModHand_compiler);
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h Sat Dec 12 21:33:55 2009
@@ -57,7 +57,7 @@
}
#endif
-#endif /* include guard */
+#endif /* Include guard. */
/**
* Copyright 2006 The Apache Software Foundation
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.c Sat Dec 12 21:33:55 2009
@@ -20,7 +20,7 @@
void
Test_init(void) {
- /* unbuffer stdout */
+ /* Unbuffer stdout. */
int check_val = setvbuf(stdout, NULL, _IONBF, 0);
if (check_val != 0)
fprintf(stderr, "Failed when trying to unbuffer stdout\n");
@@ -32,12 +32,12 @@
{
TestBatch *batch = (TestBatch*)malloc(sizeof(TestBatch));
- /* assign */
+ /* Assign. */
batch->num_tests = num_tests;
batch->name = strdup(batch_name);
batch->test_func = test_func;
- /* initialize */
+ /* Initialize. */
batch->test_num = 0;
batch->num_passed = 0;
batch->num_failed = 0;
@@ -64,10 +64,10 @@
static void
S_TestBatch_run_test(TestBatch *batch)
{
- /* print start */
+ /* Print start. */
PLAN(batch);
- /* run the batch */
+ /* Run the batch. */
batch->test_func(batch);
}
@@ -76,10 +76,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* test condition and pass or fail */
+ /* Test condition and pass or fail. */
if (value) {
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -97,10 +97,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* test condition and pass or fail */
+ /* Test condition and pass or fail. */
if (value == 0) {
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -119,10 +119,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* test condition and pass or fail */
+ /* Test condition and pass or fail. */
if (strcmp(expected, got) == 0) {
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -143,10 +143,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* test condition and pass or fail */
+ /* Test condition and pass or fail. */
if (strcmp(expected, got) != 0) {
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -165,10 +165,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* indicate pass, update pass counter */
+ /* Indicate pass, update pass counter. */
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -180,10 +180,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* indicate failure, update pass counter */
+ /* Indicate failure, update pass counter. */
printf("not ok %u - ", batch->test_num);
batch->num_failed++;
@@ -196,7 +196,7 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
if (expected == got) {
@@ -219,10 +219,10 @@
va_list args;
double diff = expected/got;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* evaluate condition and pass or fail */
+ /* Evaluate condition and pass or fail. */
if (diff > 0.00001) {
printf("ok %u - ", batch->test_num);
batch->num_passed++;
@@ -241,10 +241,10 @@
{
va_list args;
- /* increment test number */
+ /* Increment test number. */
batch->test_num++;
- /* indicate that test is being skipped, update pass counter */
+ /* Indicate that test is being skipped, update pass counter. */
printf("ok %u # SKIP ", batch->test_num);
batch->num_skipped++;
@@ -257,7 +257,7 @@
va_list args;
unsigned remaining = batch->num_tests - batch->test_num;
- /* indicate that tests are being skipped, update skip counter */
+ /* Indicate that tests are being skipped, update skip counter. */
printf("# Skipping all %u remaining tests: ", remaining);
PRINT_SUPPLIED_MESS(pat, args);
while (batch->test_num < batch->num_tests) {
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c Sat Dec 12 21:33:55 2009
@@ -11,7 +11,7 @@
{
Test_init();
- /* create a null-terminated array of test batches to iterate over */
+ /* Create a null-terminated array of test batches to iterate over. */
batches = (TestBatch**)malloc(8 * sizeof(TestBatch*));
batches[0] = TestDirManip_prepare();
batches[1] = TestFuncMacro_prepare();
@@ -32,13 +32,13 @@
int total_skipped = 0;
int i;
- /* sanity check */
+ /* Sanity check. */
if (batches == NULL) {
fprintf(stderr, "Must call AllTests_init() first.");
exit(1);
}
- /* loop through test functions, accumulating results */
+ /* Loop through test functions, accumulating results. */
for (i = 0; batches[i] != NULL; i++) {
TestBatch *batch = batches[i];
batch->run_test(batch);
@@ -49,7 +49,7 @@
batch->destroy(batch);
}
- /* print totals */
+ /* Print totals. */
printf("=============================\n");
printf("TOTAL TESTS: %d\nTOTAL PASSED: %d\nTOTAL FAILED: %d\n"
"TOTAL SKIPPED: %d\n",
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestHeaders.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestHeaders.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestHeaders.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestHeaders.c Sat Dec 12 21:33:55 2009
@@ -140,7 +140,7 @@
{
PASS(batch, "Compiled successfully with all detected headers");
- /* don't bother checking all -- just use stdio as an example */
+ /* Don't bother checking all -- just use stdio as an example. */
#ifdef HAS_STDIO_H
PASS(batch, "stdio.h should have been detected");
#else
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestIntegers.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestIntegers.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestIntegers.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestIntegers.c Sat Dec 12 21:33:55 2009
@@ -89,7 +89,7 @@
ASSERT_TRUE(batch, (sizeof(i32_t) == 4), "i32_t is 4 bytes");
ASSERT_TRUE(batch, (sizeof(u32_t) == 4), "u32_t is 4 bytes");
ASSERT_TRUE(batch, (I32_MAX == I32_C(2147483647)), "I32_MAX");
- /* the (-2147483647 - 1) avoids a compiler warning */
+ /* The (-2147483647 - 1) avoids a compiler warning. */
ASSERT_TRUE(batch, (I32_MIN == I32_C(-2147483647 - 1)), "I32_MIN");
ASSERT_TRUE(batch, (U32_MAX == U32_C(4294967295)), "U32_MAX");
}
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestLargeFiles.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestLargeFiles.c?rev=889983&r1=889982&r2=889983&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestLargeFiles.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/TestLargeFiles.c Sat Dec 12 21:33:55 2009
@@ -24,11 +24,11 @@
int check_val;
char check_char;
- /* a little over 4 GB, and a little over 2 GB */
+ /* A little over 4 GB, and a little over 2 GB. */
off64_t gb4_plus = ((off64_t)0x7FFFFFFF << 1) + 100;
off64_t gb2_plus = (off64_t)0x7FFFFFFF + 200;
- /* gb4_plus modulo 4 GB (wrap is intentional) */
+ /* Gb4_plus modulo 4 GB (wrap is intentional). */
i32_t wrap_gb4 = (i32_t)gb4_plus;
ASSERT_INT_EQ(batch, sizeof(off64_t), 8, "off64_t type has 8 bytes");
@@ -75,7 +75,7 @@
check_val = fclose(fh);
ASSERT_INT_EQ(batch, check_val, 0, "fclose succeeds after all that");
- /* truncate, just in case the call to remove fails */
+ /* Truncate, just in case the call to remove fails. */
fh = fopen64("_charm_large_file_test", "w+");
if (fh != NULL)
fclose(fh);