FAQ

svn commit: r882834 - in /lucene/lucy/trunk/charmonizer: ./ src/Charmonizer/ src/Charmonizer/Core/ src/Charmonizer/Probe/ src/Charmonizer/Test/

Marvin
Nov 21, 2009 at 5:58 am
Author: marvin
Date: Sat Nov 21 05:58:22 2009
New Revision: 882834

URL: http://svn.apache.org/viewvc?rev=882834&view=rev
Log:
Commit LUCY-70, applying style changes to static function names in Charmonizer.

Modified:
lucene/lucy/trunk/charmonizer/charmonize.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm

Modified: lucene/lucy/trunk/charmonizer/charmonize.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/charmonize.c?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/charmonize.c (original)
+++ lucene/lucy/trunk/charmonizer/charmonize.c Sat Nov 21 05:58:22 2009
@@ -29,18 +29,18 @@
* them as a newly allocated substring.
*/
static char*
-extract_delim(char *source, size_t source_len, const char *tag_name);
+S_extract_delim(char *source, size_t source_len, const char *tag_name);

/* Version of extract delim which dies rather than returns NULL upon failure.
*/
static char*
-extract_delim_and_verify(char *source, size_t source_len,
- const char *tag_name);
+S_extract_delim_and_verify(char *source, size_t source_len,
+ const char *tag_name);

/* Write some stuff to the end of charmony.h
*/
static void
-write_charmony_postamble(void);
+S_write_charmony_postamble(void);

/* Print a message to stderr and exit.
*/
@@ -62,7 +62,7 @@
chaz_VariadicMacros_run();

/* write custom postamble */
- write_charmony_postamble();
+ S_write_charmony_postamble();

/* clean up */
chaz_Probe_clean_up();
@@ -84,13 +84,13 @@
if (argc != 2)
die("Usage: ./charmonize INFILE");
infile_str = chaz_Probe_slurp_file(argv[1], &infile_len);
- cc_command = extract_delim_and_verify(infile_str, infile_len,
+ cc_command = S_extract_delim_and_verify(infile_str, infile_len,
"charm_cc_command");
- cc_flags = extract_delim_and_verify(infile_str, infile_len,
+ cc_flags = S_extract_delim_and_verify(infile_str, infile_len,
"charm_cc_flags");
- os_name = extract_delim_and_verify(infile_str, infile_len,
+ os_name = S_extract_delim_and_verify(infile_str, infile_len,
"charm_os_name");
- verbosity_str = extract_delim(infile_str, infile_len, "charm_verbosity");
+ verbosity_str = S_extract_delim(infile_str, infile_len, "charm_verbosity");

/* set up Charmonizer */
if (verbosity_str != NULL) {
@@ -104,7 +104,7 @@
}

static char*
-extract_delim(char *source, size_t source_len, const char *tag_name)
+S_extract_delim(char *source, size_t source_len, const char *tag_name)
{
const size_t tag_name_len = strlen(tag_name);
const size_t opening_delim_len = tag_name_len + 2;
@@ -144,16 +144,17 @@
}

static char*
-extract_delim_and_verify(char *source, size_t source_len, const char *tag_name)
+S_extract_delim_and_verify(char *source, size_t source_len,
+ const char *tag_name)
{
- char *retval = extract_delim(source, source_len, tag_name);
+ char *retval = S_extract_delim(source, source_len, tag_name);
if (retval == NULL)
die("Couldn't extract value for '%s'", tag_name);
return retval;
}

static void
-write_charmony_postamble(void)
+S_write_charmony_postamble(void)
{
if (chaz_HeadCheck_check_header("sys/mman.h")) {
chaz_ModHand_append_conf("#define CHY_HAS_SYS_MMAN_H\n\n");
@@ -172,7 +173,7 @@
}

/**
- * Copyright 2006 The Apache Software Foundation
+ * Copyright 2006-2009 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm Sat Nov 21 05:58:22 2009
@@ -10,21 +10,21 @@
extern chaz_bool_t chaz_ModHand_charm_run_available;

static void
-destroy(Compiler *self);
+S_destroy(Compiler *self);

static chaz_bool_t
-compile_exe(Compiler *self, const char *source_path, const char *exe_path,
- const char *code, size_t code_len);
+S_compile_exe(Compiler *self, const char *source_path, const char *exe_path,
+ const char *code, size_t code_len);

static chaz_bool_t
-compile_obj(Compiler *self, const char *source_path, const char *obj_path,
- const char *code, size_t code_len);
+S_compile_obj(Compiler *self, const char *source_path, const char *obj_path,
+ const char *code, size_t code_len);

static void
-add_inc_dir(Compiler *self, const char *dir);
+S_add_inc_dir(Compiler *self, const char *dir);

static void
-do_test_compile(Compiler *self);
+S_do_test_compile(Compiler *self);

chaz_Compiler*
chaz_CC_new(OperSys *oper_sys, const char *cc_command, const char *cc_flags)
@@ -43,10 +43,10 @@
/* init */
self->buf = NULL;
self->buf_len = 0;
- self->compile_exe = compile_exe;
- self->compile_obj = compile_obj;
- self->add_inc_dir = add_inc_dir;
- self->destroy = destroy;
+ 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 */
@@ -58,13 +58,13 @@
self->add_inc_dir(self, ".");

/* if we can't compile anything, game over */
- do_test_compile(self);
+ S_do_test_compile(self);

return self;
}

static void
-destroy(Compiler *self)
+S_destroy(Compiler *self)
{
char **inc_dirs;

@@ -83,8 +83,8 @@
}

static chaz_bool_t
-compile_exe(Compiler *self, const char *source_path, const char *exe_path,
- const char *code, size_t code_len)
+S_compile_exe(Compiler *self, const char *source_path, const char *exe_path,
+ const char *code, size_t code_len)
{
chaz_bool_t successful;
OperSys *os = self->os;
@@ -124,8 +124,8 @@
}

static chaz_bool_t
-compile_obj(Compiler *self, const char *source_path, const char *obj_path,
- const char *code, size_t code_len)
+S_compile_obj(Compiler *self, const char *source_path, const char *obj_path,
+ const char *code, size_t code_len)
{
chaz_bool_t successful;
OperSys *os = self->os;
@@ -160,7 +160,7 @@
}

static void
-do_test_compile(Compiler *self)
+S_do_test_compile(Compiler *self)
{
char *code = "int main() { return 0; }\n";
chaz_bool_t success;
@@ -180,7 +180,7 @@
}

static void
-add_inc_dir(Compiler *self, const char *dir)
+S_add_inc_dir(Compiler *self, const char *dir)
{
size_t num_dirs = 0;
char **dirs = self->inc_dirs;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.charm Sat Nov 21 05:58:22 2009
@@ -49,7 +49,7 @@
METAQUOTE;

static chaz_bool_t
-try_init_posix_mkdir(char *header)
+S_try_init_posix_mkdir(char *header)
{
size_t needed = sizeof(posix_mkdir_code) + 30;
char *code_buf = malloc(needed);
@@ -75,7 +75,7 @@
}

static chaz_bool_t
-try_init_win_mkdir()
+S_try_init_win_mkdir()
{
mkdir_available = compiler->compile_exe(compiler, "_charm_mkdir.c",
"_charm_mkdir", win_mkdir_code, strlen(win_mkdir_code));
@@ -87,18 +87,18 @@
}

static void
-init_mkdir()
+S_init_mkdir()
{
if (verbosity) {
printf("Attempting to compile _charm_mkdir utility...\n");
}
- if (try_init_win_mkdir()) { return; }
- if (try_init_posix_mkdir("sys/stat.h")) { return; }
- if (try_init_posix_mkdir("direct.h")) { return; }
+ if (S_try_init_win_mkdir()) { return; }
+ if (S_try_init_posix_mkdir("sys/stat.h")) { return; }
+ if (S_try_init_posix_mkdir("direct.h")) { return; }
}

static chaz_bool_t
-try_init_rmdir(char *header)
+S_try_init_rmdir(char *header)
{
size_t needed = sizeof(posix_mkdir_code) + 30;
char *code_buf = malloc(needed);
@@ -110,14 +110,14 @@
}

static void
-init_rmdir()
+S_init_rmdir()
{
if (verbosity) {
printf("Attempting to compile _charm_rmdir utility...\n");
}
- if (try_init_rmdir("unistd.h")) { return; }
- if (try_init_rmdir("dirent.h")) { return; }
- if (try_init_rmdir("direct.h")) { return; }
+ if (S_try_init_rmdir("unistd.h")) { return; }
+ if (S_try_init_rmdir("dirent.h")) { return; }
+ if (S_try_init_rmdir("direct.h")) { return; }
}

/* Compile _charm_mkdir and _charm_rmdir. */
@@ -126,8 +126,8 @@
{
if (!initialized) {
initialized = true;
- init_mkdir();
- init_rmdir();
+ S_init_mkdir();
+ S_init_rmdir();
}
}


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.charm Sat Nov 21 05:58:22 2009
@@ -26,24 +26,24 @@
/* Comparison function to feed to qsort, bsearch, etc.
*/
static int
-compare_headers(const void *vptr_a, const void *vptr_b);
+S_compare_headers(const void *vptr_a, const void *vptr_b);

/* Run a test compilation and return a new Header object encapsulating the
* results.
*/
static Header*
-discover_header(const char *header_name);
+S_discover_header(const char *header_name);

/* Extend the cache, add this Header object to it, and sort.
*/
static void
-add_to_cache(Header *header);
+S_add_to_cache(Header *header);

/* Like add_to_cache, but takes a individual elements instead of a Header* and
* checks if header exists in array first.
*/
static void
-maybe_add_to_cache(const char *header_name, chaz_bool_t exists);
+S_maybe_add_to_cache(const char *header_name, chaz_bool_t exists);

void
chaz_HeadCheck_init()
@@ -70,12 +70,12 @@
key.name = (char*)header_name;
key.exists = false;
header_ptr = bsearch(&fake, header_cache, cache_size, sizeof(void*),
- compare_headers);
+ S_compare_headers);

/* if it's not there, go try a test compile */
if (header_ptr == NULL) {
- header = discover_header(header_name);
- add_to_cache(header);
+ header = S_discover_header(header_name);
+ S_add_to_cache(header);
}
else {
header = *header_ptr;
@@ -102,7 +102,7 @@
success = test_compile(code_buf, strlen(code_buf));
if (success) {
for (i = 0; header_names[i] != NULL; i++) {
- maybe_add_to_cache(header_names[i], true);
+ S_maybe_add_to_cache(header_names[i], true);
}
}

@@ -131,7 +131,7 @@
}

static int
-compare_headers(const void *vptr_a, const void *vptr_b) {
+S_compare_headers(const void *vptr_a, const void *vptr_b) {
Header **const a = (Header**)vptr_a;
Header **const b = (Header**)vptr_b;

@@ -144,7 +144,7 @@
}

static Header*
-discover_header(const char *header_name) {
+S_discover_header(const char *header_name) {
Header* header = (Header*)malloc(sizeof(Header));

/* assign */
@@ -160,7 +160,7 @@
}

static void
-add_to_cache(Header *header)
+S_add_to_cache(Header *header)
{
/* realloc array -- inefficient, but this isn't a bottleneck */
cache_size++;
@@ -168,11 +168,11 @@
header_cache[ cache_size - 1 ] = header;

/* keep the list of headers sorted */
- qsort(header_cache, cache_size, sizeof(*header_cache), compare_headers);
+ qsort(header_cache, cache_size, sizeof(*header_cache), S_compare_headers);
}

static void
-maybe_add_to_cache(const char *header_name, chaz_bool_t exists)
+S_maybe_add_to_cache(const char *header_name, chaz_bool_t exists)
{
Header *header;
Header key;
@@ -182,14 +182,14 @@
key.name = (char*)header_name;
key.exists = exists;
header = bsearch(&fake, header_cache, cache_size, sizeof(void*),
- compare_headers);
+ S_compare_headers);

/* 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);
header->exists = exists;
- add_to_cache(header);
+ S_add_to_cache(header);
}
}


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm Sat Nov 21 05:58:22 2009
@@ -13,18 +13,18 @@
/* Write the "_charm.h" file used by every probe.
*/
static void
-write_charm_h();
+S_write_charm_h();

/* Compile a small wrapper application which is used to redirect error output
* to devnull.
*/
static void
-build_charm_run();
+S_build_charm_run();

/* Clean up the files associated with capture_output().
*/
static void
-clean_up_try();
+S_clean_up_try();

/* global vars */
struct chaz_OperSys *chaz_ModHand_os = NULL;
@@ -47,8 +47,8 @@
try_app_path, NULL);

/* write files needed by this module and others */
- build_charm_run();
- write_charm_h();
+ S_build_charm_run();
+ S_write_charm_h();
}

void
@@ -98,7 +98,7 @@
METAQUOTE;

static void
-write_charm_h()
+S_write_charm_h()
{
write_file("_charm.h", charm_h_code, strlen(charm_h_code));
}
@@ -151,7 +151,7 @@
METAQUOTE;

static void
-build_charm_run()
+S_build_charm_run()
{
char *code = NULL;
chaz_bool_t compile_succeeded = false;
@@ -181,7 +181,7 @@
compile_succeeded = compiler->compile_exe(compiler, TRY_SOURCE_PATH,
TRY_APP_BASENAME, source, source_len);

- clean_up_try();
+ S_clean_up_try();

return compile_succeeded;
}
@@ -211,7 +211,7 @@
}

/* remove all the files we just created */
- clean_up_try();
+ S_clean_up_try();

return captured_output;
}
@@ -227,7 +227,7 @@
}

static void
-clean_up_try()
+S_clean_up_try()
{
remove(TRY_SOURCE_PATH);
os->remove_exe(os, TRY_APP_BASENAME);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.charm Sat Nov 21 05:58:22 2009
@@ -8,19 +8,19 @@
#include "Charmonizer/Core/OperSys.h"

static void
-probe_devnull(OperSys *self);
+S_probe_devnull(OperSys *self);

static void
-destroy(OperSys *self);
+S_destroy(OperSys *self);

static void
-remove_exe(OperSys *self, char *name);
+S_remove_exe(OperSys *self, char *name);

static void
-remove_obj(OperSys *self, char *name);
+S_remove_obj(OperSys *self, char *name);

static int
-run_local(OperSys *self, ...);
+S_run_local(OperSys *self, ...);

chaz_OperSys*
chaz_OS_new(const char *name)
@@ -36,10 +36,10 @@
/* init */
self->buf = NULL;
self->buf_len = 0;
- self->remove_obj = remove_obj;
- self->remove_exe = remove_exe;
- self->run_local = run_local;
- self->destroy = destroy;
+ self->remove_obj = S_remove_obj;
+ self->remove_exe = S_remove_exe;
+ self->run_local = S_run_local;
+ self->destroy = S_destroy;

/* derive */
if (strcmp(name, "mswin32") == 0) {
@@ -52,14 +52,14 @@
self->obj_ext = strdup("");
self->exe_ext = strdup("");
self->local_command_start = strdup("./");
- probe_devnull(self);
+ S_probe_devnull(self);
}

return self;
}

static void
-probe_devnull(OperSys *self)
+S_probe_devnull(OperSys *self)
{
char *const devnull_options[] = {
"/dev/null",
@@ -84,7 +84,7 @@
}

static void
-destroy(OperSys *self)
+S_destroy(OperSys *self)
{
free(self->buf);
free(self->name);
@@ -96,7 +96,7 @@
}

static void
-remove_exe(OperSys *self, char *name)
+S_remove_exe(OperSys *self, char *name)
{
self->buf_len = join_strings(&(self->buf), self->buf_len, name,
self->exe_ext, NULL);
@@ -104,7 +104,7 @@
}

static void
-remove_obj(OperSys *self, char *name)
+S_remove_obj(OperSys *self, char *name)
{
self->buf_len = join_strings(&(self->buf), self->buf_len, name,
self->obj_ext, NULL);
@@ -112,7 +112,7 @@
}

static int
-run_local(OperSys *self, ...)
+S_run_local(OperSys *self, ...)
{
va_list args;


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.charm Sat Nov 21 05:58:22 2009
@@ -16,7 +16,7 @@

/* lazily compile _charm_stat */
static void
-init();
+S_init();

void
chaz_Stat_stat(const char *filepath, chaz_Stat *target)
@@ -29,7 +29,7 @@

/* lazy init */
if (!initialized)
- init();
+ S_init();

/* bail out if we didn't succeed in compiling/using _charm_stat */
if (!stat_available)
@@ -70,7 +70,7 @@
METAQUOTE;

static void
-init()
+S_init()
{
/* only try this once */
initialized = true;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm Sat Nov 21 05:58:22 2009
@@ -39,7 +39,7 @@
METAQUOTE;

static char*
-try_inline(const char *keyword, size_t *output_len) {
+S_try_inline(const char *keyword, size_t *output_len) {
char code[ sizeof(inline_code) + 30 ];
sprintf(code, inline_code, keyword);
return capture_output(code, strlen(code), output_len);
@@ -107,7 +107,7 @@

for (i = 0; i < num_inline_options; i++) {
const char *inline_option = inline_options[i];
- output = try_inline(inline_option, &output_len);
+ output = S_try_inline(inline_option, &output_len);
if (output != NULL) {
has_inline = true;
append_conf("#define CHY_INLINE %s\n", inline_option);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm Sat Nov 21 05:58:22 2009
@@ -18,7 +18,7 @@
/* Add a header to the keepers array.
*/
static void
-keep(const char *header_name);
+S_keep(const char *header_name);

static size_t aff_buf_size = 0;
static char *aff_buf = NULL;
@@ -27,7 +27,7 @@
* [aff_buf].
*/
static void
-encode_affirmation(const char *header_name);
+S_encode_affirmation(const char *header_name);

#define NUM_C89_HEADERS 15
char *c89_headers[] = {
@@ -98,14 +98,14 @@
has_posix = true;
append_conf("#define CHY_HAS_POSIX\n");
for (i = 0; posix_headers[i] != NULL; i++) {
- keep(posix_headers[i]);
+ S_keep(posix_headers[i]);
}
}
/* Test one-at-a-time. */
else {
for (i = 0; posix_headers[i] != NULL; i++) {
if (check_header(posix_headers[i])) {
- keep(posix_headers[i]);
+ S_keep(posix_headers[i]);
}
}
}
@@ -116,14 +116,14 @@
append_conf("#define CHY_HAS_C89\n");
append_conf("#define CHY_HAS_C90\n");
for (i = 0; c89_headers[i] != NULL; i++) {
- keep(c89_headers[i]);
+ S_keep(c89_headers[i]);
}
}
/* Test one-at-a-time. */
else {
for (i = 0; c89_headers[i] != NULL; i++) {
if (check_header(c89_headers[i])) {
- keep(c89_headers[i]);
+ S_keep(c89_headers[i]);
}
}
}
@@ -131,21 +131,21 @@
/* Test for all Windows headers in one blast */
if (check_many_headers((const char**)win_headers)) {
for (i = 0; win_headers[i] != NULL; i++) {
- keep(win_headers[i]);
+ S_keep(win_headers[i]);
}
}
/* Test one-at-a-time. */
else {
for (i = 0; win_headers[i] != NULL; i++) {
if (check_header(win_headers[i])) {
- keep(win_headers[i]);
+ S_keep(win_headers[i]);
}
}
}

/* append the config with every header detected so far */
for (i = 0; keepers[i] != NULL; i++) {
- encode_affirmation(keepers[i]);
+ S_encode_affirmation(keepers[i]);
append_conf("#define CHY_%s\n", aff_buf);
}

@@ -158,7 +158,7 @@
shorten_macro("HAS_C90");
}
for (i = 0; keepers[i] != NULL; i++) {
- encode_affirmation(keepers[i]);
+ S_encode_affirmation(keepers[i]);
shorten_macro(aff_buf);
}
END_SHORT_NAMES;
@@ -167,7 +167,7 @@
}

static void
-keep(const char *header_name)
+S_keep(const char *header_name)
{
if (keeper_count >= MAX_KEEPER_COUNT)
die("Too many keepers -- increase MAX_KEEPER_COUNT");
@@ -176,7 +176,7 @@
}

static void
-encode_affirmation(const char *header_name) {
+S_encode_affirmation(const char *header_name) {
char *buf, *buf_end;
size_t len = strlen(header_name) + sizeof("HAS_");


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm Sat Nov 21 05:58:22 2009
@@ -14,7 +14,7 @@
/* Determine endian-ness of this machine.
*/
static chaz_bool_t
-machine_is_big_endian();
+S_machine_is_big_endian();

static char sizes_code[] = METAQUOTE
#include "_charm.h"
@@ -81,7 +81,7 @@
START_RUN("Integers");

/* document endian-ness */
- if (machine_is_big_endian())
+ if (S_machine_is_big_endian())
append_conf("#define CHY_BIG_END\n");
else
append_conf("#define CHY_LITTLE_END\n");
@@ -335,7 +335,7 @@

/* shorten */
START_SHORT_NAMES;
- if ( machine_is_big_endian() ) {
+ if ( S_machine_is_big_endian() ) {
shorten_macro("BIG_END");
}
else {
@@ -402,7 +402,7 @@
}

static chaz_bool_t
-machine_is_big_endian()
+S_machine_is_big_endian()
{
long one = 1;
return !(*((char *)(&one)));

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm Sat Nov 21 05:58:22 2009
@@ -36,23 +36,23 @@
/* Check what name 64-bit ftell, fseek go by.
*/
static chaz_bool_t
-probe_off64(off64_combo *combo);
+S_probe_off64(off64_combo *combo);

/* Determine whether we can use sparse files.
*/
static chaz_bool_t
-check_sparse_files();
+S_check_sparse_files();

/* Helper for check_sparse_files().
*/
static void
-test_sparse_file(long offset, Stat *st);
+S_test_sparse_file(long offset, Stat *st);

/* See if trying to write a 5 GB file in a subprocess bombs out. If it
* doesn't, then the test suite can safely verify large file support.
*/
static chaz_bool_t
-can_create_big_files();
+S_can_create_big_files();

static char* code_buf = NULL;
static size_t code_buf_len = 0;
@@ -74,7 +74,7 @@
/* see if off64_t and friends exist or have synonyms */
for (i = 0; off64_combos[i].includes != NULL; i++) {
off64_combo combo = off64_combos[i];
- success = probe_off64(&combo);
+ success = S_probe_off64(&combo);
if (success) {
strcpy(fopen_command, combo.fopen_command);
strcpy(fseek_command, combo.fseek_command);
@@ -97,10 +97,10 @@
}

/* check for sparse files */
- if (check_sparse_files()) {
+ if (S_check_sparse_files()) {
append_conf("#define CHAZ_HAS_SPARSE_FILES\n");
/* see if we can create a 5 GB file without crashing */
- if (success && can_create_big_files())
+ if (success && S_can_create_big_files())
append_conf("#define CHAZ_CAN_CREATE_BIG_FILES\n");
}
else {
@@ -150,7 +150,7 @@


static chaz_bool_t
-probe_off64(off64_combo *combo)
+S_probe_off64(off64_combo *combo)
{
char *output = NULL;
size_t output_len;
@@ -182,7 +182,7 @@
}

static chaz_bool_t
-check_sparse_files()
+S_check_sparse_files()
{
Stat st_a, st_b;

@@ -191,8 +191,8 @@
return false;

/* write and stat a 1 MB file and a 2 MB file, both of them sparse */
- test_sparse_file(1000000, &st_a);
- test_sparse_file(2000000, &st_b);
+ S_test_sparse_file(1000000, &st_a);
+ S_test_sparse_file(2000000, &st_b);
if (!(st_a.valid && st_b.valid))
return false;
if (st_a.size != 1000001)
@@ -208,7 +208,7 @@
}

static void
-test_sparse_file(long offset, Stat *st)
+S_test_sparse_file(long offset, Stat *st)
{
FILE *sparse_fh;

@@ -258,7 +258,7 @@
METAQUOTE;

static chaz_bool_t
-can_create_big_files()
+S_can_create_big_files()
{
char *output;
size_t output_len;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.charm Sat Nov 21 05:58:22 2009
@@ -7,10 +7,10 @@
#include "Charmonizer/Test.h"

static void
-TestBatch_destroy(TestBatch *batch);
+S_TestBatch_destroy(TestBatch *batch);

static void
-TestBatch_run_test(TestBatch *batch);
+S_TestBatch_run_test(TestBatch *batch);

#define PRINT_SUPPLIED_MESS(_pattern, _args) \
va_start(args, pat); \
@@ -42,8 +42,8 @@
batch->num_passed = 0;
batch->num_failed = 0;
batch->num_skipped = 0;
- batch->destroy = TestBatch_destroy;
- batch->run_test = TestBatch_run_test;
+ batch->destroy = S_TestBatch_destroy;
+ batch->run_test = S_TestBatch_run_test;

return batch;
}
@@ -55,14 +55,14 @@
}

static void
-TestBatch_destroy(TestBatch *batch)
+S_TestBatch_destroy(TestBatch *batch)
{
free(batch->name);
free(batch);
}

static void
-TestBatch_run_test(TestBatch *batch)
+S_TestBatch_run_test(TestBatch *batch)
{
/* print start */
PLAN(batch);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm?rev=882834&r1=882833&r2=882834&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm Sat Nov 21 05:58:22 2009
@@ -12,7 +12,7 @@
}

#ifdef INLINE
-static INLINE char* inline_function()
+static INLINE char* S_inline_function()
{
return "inline works";
}
@@ -44,7 +44,7 @@
#endif

#ifdef INLINE
- PASS(batch, inline_function());
+ PASS(batch, S_inline_function());
#else
SKIP(batch, "no INLINE functions");
#endif
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Marvin: 1 post