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 2006/11/04 00:53:51 UTC
svn commit: r471061 - in /lucene/lucy/trunk/charmonizer/src/Charmonizer:
Core/ModHandler.charm Core/ModHandler.harm Probe/FuncMacro.charm
Probe/Headers.charm Probe/Integers.charm Probe/LargeFiles.charm
Probe/UnusedVars.charm Probe/VariadicMacros.charm
Author: marvin
Date: Fri Nov 3 15:53:50 2006
New Revision: 471061
URL: http://svn.apache.org/viewvc?view=rev&rev=471061
Log:
Change signature of append_conf: remove passed-in filehandle. (Use the global
variable stored copy instead).
Modified:
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm
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/Probe/UnusedVars.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm
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?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm Fri Nov 3 15:53:50 2006
@@ -185,12 +185,12 @@
}
void
-chaz_ModHand_append_conf(FILE *conf_fh, char *fmt, ...)
+chaz_ModHand_append_conf(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(conf_fh, fmt, args);
+ vfprintf(chaz_ModHand_conf_fh, fmt, args);
va_end(args);
if (want_charm_test_h) {
@@ -211,29 +211,25 @@
void
chaz_ModHand_shorten_constant(const char *sym)
{
- append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
- sym, constant_prefix, sym);
+ append_conf("# define %s %s%s\n", sym, constant_prefix, sym);
}
void
chaz_ModHand_shorten_macro(const char *sym)
{
- append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
- sym, macro_prefix, sym);
+ append_conf("# define %s %s%s\n", sym, macro_prefix, sym);
}
void
chaz_ModHand_shorten_typedef(const char *sym)
{
- append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
- sym, typedef_prefix, sym);
+ append_conf("# define %s %s%s\n", sym, typedef_prefix, sym);
}
void
chaz_ModHand_shorten_function(const char *sym)
{
- append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
- sym, function_prefix, sym);
+ append_conf("# define %s %s%s\n", sym, function_prefix, sym);
}
void
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm Fri Nov 3 15:53:50 2006
@@ -58,17 +58,17 @@
* _charm_test.h, if indicated.
*/
void
-chaz_ModHand_append_conf(FILE *conf_fh, char *fmt, ...);
+chaz_ModHand_append_conf(char *fmt, ...);
/* Print bookends delimiting a short names block.
*/
#define Chaz_ModHand_Start_Short_Names(conf_fh) \
- append_conf(conf_fh, \
+ append_conf( \
"\n#if defined(%sUSE_SHORT_NAMES) || defined(CHAZ_USE_SHORT_NAMES)\n", \
chaz_ModHand_constant_prefix)
#define Chaz_ModHand_End_Short_Names(conf_fh) \
- append_conf(conf_fh, \
+ append_conf( \
"#endif /* USE_SHORT_NAMES */\n", chaz_ModHand_constant_prefix)
/* Define a shortened version of a constant symbol (minus the prefix);
@@ -100,7 +100,7 @@
*/
#define Chaz_ModHand_Start_Run(filehandle, module_name) \
do { \
- append_conf(filehandle, "\n/* %s */\n", module_name); \
+ append_conf("\n/* %s */\n", module_name); \
if (verbosity > 0) \
printf("Running %s module...\n", module_name); \
} while (0)
@@ -108,7 +108,7 @@
/* Leave a little whitespace at the end of each module.
*/
#define Chaz_ModHand_End_Run(filehandle) \
- append_conf(filehandle, "\n")
+ append_conf("\n")
#ifdef CHAZ_USE_SHORT_NAMES
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?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm Fri Nov 3 15:53:50 2006
@@ -61,20 +61,18 @@
char *macro_text = has_iso_funcmac
? "__func__"
: "__FUNCTION__";
- append_conf(conf_fh,
- "#define %sHAS_FUNC_MACRO\n"
+ append_conf(
+ "#define %sHAS_FUNC_MACRO\n"
"#define %sFunc_Macro %s\n",
constant_prefix, macro_prefix, macro_text);
}
/* write out specific defines */
if (has_iso_funcmac) {
- append_conf(conf_fh, "#define %sHAS_ISO_FUNC_MACRO\n",
- constant_prefix);
+ append_conf("#define %sHAS_ISO_FUNC_MACRO\n", constant_prefix);
}
if (has_gnuc_funcmac) {
- append_conf(conf_fh, "#define %sHAS_GNUC_FUNC_MACRO\n",
- constant_prefix);
+ append_conf("#define %sHAS_GNUC_FUNC_MACRO\n", constant_prefix);
}
if (want_short_names) {
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?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm Fri Nov 3 15:53:50 2006
@@ -82,7 +82,7 @@
/* test for all POSIX headers in one blast */
if (check_many_headers((const char**)posix_headers)) {
has_posix = true;
- append_conf(conf_fh, "#define %sHAS_POSIX\n", constant_prefix);
+ append_conf("#define %sHAS_POSIX\n", constant_prefix);
for (i = 0; posix_headers[i] != NULL; i++) {
keep(posix_headers[i]);
}
@@ -91,8 +91,8 @@
/* test for all c89 headers in one blast */
if (check_many_headers((const char**)c89_headers)) {
has_c89 = true;
- append_conf(conf_fh, "#define %sHAS_C89\n", constant_prefix);
- append_conf(conf_fh, "#define %sHAS_C90\n", constant_prefix);
+ append_conf("#define %sHAS_C89\n", constant_prefix);
+ append_conf("#define %sHAS_C90\n", constant_prefix);
for (i = 0; c89_headers[i] != NULL; i++) {
keep(c89_headers[i]);
}
@@ -101,7 +101,7 @@
/* append the config with every header detected so far */
for (i = 0; keepers[i] != NULL; i++) {
encode_affirmation(keepers[i]);
- append_conf(conf_fh, "#define %s%s\n", constant_prefix, aff_buf);
+ append_conf("#define %s%s\n", constant_prefix, aff_buf);
}
if (want_short_names) {
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?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm Fri Nov 3 15:53:50 2006
@@ -88,9 +88,9 @@
/* document endian-ness */
if (machine_is_big_endian())
- append_conf(conf_fh, "#define %sBIG_END\n", constant_prefix);
+ append_conf("#define %sBIG_END\n", constant_prefix);
else
- append_conf(conf_fh, "#define %sLITTLE_END\n", constant_prefix);
+ append_conf("#define %sLITTLE_END\n", constant_prefix);
/* Record sizeof() for several common integer types. */
output = capture_output(sizes_code, strlen(sizes_code), &output_len);
@@ -171,14 +171,14 @@
/* write out some conditional defines */
if (has_inttypes)
- append_conf(conf_fh, "#define %sHAS_INTTYPES_H\n", constant_prefix);
+ append_conf("#define %sHAS_INTTYPES_H\n", constant_prefix);
if (has_long_long)
- append_conf(conf_fh, "#define %sHAS_LONG_LONG\n", constant_prefix);
+ append_conf("#define %sHAS_LONG_LONG\n", constant_prefix);
if (has___int64)
- append_conf(conf_fh, "#define %sHAS___INT64\n", constant_prefix);
+ append_conf("#define %sHAS___INT64\n", constant_prefix);
/* write out sizes */
- append_conf(conf_fh,
+ append_conf(
"#define %sSIZEOF_CHAR %d\n"
"#define %sSIZEOF_SHORT %d\n"
"#define %sSIZEOF_INT %d\n"
@@ -191,24 +191,24 @@
constant_prefix, sizeof_ptr
);
if (has_long_long) {
- append_conf(conf_fh, "#define %sSIZEOF_LONG_LONG %d\n",
+ append_conf("#define %sSIZEOF_LONG_LONG %d\n",
constant_prefix, sizeof_long_long);
}
if (has___int64) {
- append_conf(conf_fh, "#define %sSIZEOF___INT64 %d\n",
+ append_conf("#define %sSIZEOF___INT64 %d\n",
constant_prefix, sizeof___int64);
}
/* write affirmations, typedefs and maximums/minimums */
- append_conf(conf_fh, "typedef int %sbool_t;\n", typedef_prefix);
+ append_conf("typedef int %sbool_t;\n", typedef_prefix);
if (has_8) {
- append_conf(conf_fh,
+ append_conf(
"#define %sHAS_I8_T\n"
"typedef char %si8_t;\n"
"typedef unsigned char %su8_t;\n",
constant_prefix, typedef_prefix, typedef_prefix
);
- append_conf(conf_fh,
+ append_conf(
"#define %sI8_MAX 0x7F\n"
"#define %sI8_MIN (-I8_MAX - 1)\n"
"#define %sU8_MAX (I8_MAX * 2 + 1)\n",
@@ -216,13 +216,13 @@
);
}
if (has_16) {
- append_conf(conf_fh,
+ append_conf(
"#define %sHAS_I16_T\n"
"typedef short %si16_t;\n"
"typedef unsigned short %su16_t;\n",
constant_prefix, typedef_prefix, typedef_prefix
);
- append_conf(conf_fh,
+ append_conf(
"#define %sI16_MAX 0x7FFF\n"
"#define %sI16_MIN (-I16_MAX - 1)\n"
"#define %sU16_MAX (I16_MAX * 2 + 1)\n",
@@ -230,7 +230,7 @@
);
}
if (has_32) {
- append_conf(conf_fh,
+ append_conf(
"#define %sHAS_I32_T\n"
"typedef %s %si32_t;\n"
"typedef unsigned %s %su32_t;\n",
@@ -238,7 +238,7 @@
i32_t_type, typedef_prefix,
i32_t_type, typedef_prefix
);
- append_conf(conf_fh,
+ append_conf(
"#define %sI32_MAX 0x7FFFFFFF%s\n"
"#define %sI32_MIN (-I32_MAX - 1)\n"
"#define %sU32_MAX (I32_MAX * 2%s + 1%s)\n",
@@ -248,7 +248,7 @@
);
}
if (has_64) {
- append_conf(conf_fh,
+ append_conf(
"#define %sHAS_I64_T\n"
"typedef %s %si64_t;\n"
"typedef unsigned %s %su64_t;\n",
@@ -256,7 +256,7 @@
i64_t_type, typedef_prefix,
i64_t_type, typedef_prefix
);
- append_conf(conf_fh,
+ append_conf(
"#define %sI64_MAX 0x7FFFFFFFFFFFFFFF%s\n"
"#define %sI64_MIN (-I64_MAX - 1%s)\n"
"#define %sU64_MAX (I64_MAX * 2%s + 1%s)\n",
@@ -303,7 +303,7 @@
if ( output_len != 0
&& strcmp(output, "18446744073709551615") == 0
) {
- append_conf(conf_fh,
+ append_conf(
"#define %sI64P \"%sd\"\n"
"#define %sU64P \"%su\"\n",
macro_prefix, options[i],
@@ -318,7 +318,7 @@
/* write out the 32-bit and 64-bit literal macros */
if (has_32) {
if (strcmp(i32_t_postfix, "") == 0) {
- append_conf(conf_fh,
+ append_conf(
"#define %sI32_C(n) n\n"
"#define %sU32_C(n) n##%s\n",
macro_prefix,
@@ -326,7 +326,7 @@
);
}
else {
- append_conf(conf_fh,
+ append_conf(
"#define %sI32_C(n) n##%s\n"
"#define %sU32_C(n) n##%s\n",
macro_prefix, i32_t_postfix,
@@ -335,7 +335,7 @@
}
}
if (has_64) {
- append_conf(conf_fh,
+ append_conf(
"#define %sI64_C(n) n##%s\n"
"#define %sU64_C(n) n##%s\n",
macro_prefix, i64_t_postfix,
@@ -344,7 +344,7 @@
}
/* true and false */
- append_conf(conf_fh,
+ append_conf(
"#ifndef true\n"
"# define true 1\n"
"#endif\n"
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?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm Fri Nov 3 15:53:50 2006
@@ -74,11 +74,10 @@
/* write the affirmations/definitions */
if (success) {
- append_conf(conf_fh,
- "#define %sHAS_LARGE_FILE_SUPPORT\n", constant_prefix );
+ append_conf("#define %sHAS_LARGE_FILE_SUPPORT\n", constant_prefix );
/* alias these only if they're not already provided and correct */
if (strcmp(loff_type, "off64_t") != 0) {
- append_conf(conf_fh,
+ append_conf(
"#define %soff64_t %s\n"
"#define %sftello64 %s\n"
"#define %sfseeko64 %s\n",
@@ -91,13 +90,13 @@
/* check for sparse files */
if (check_sparse_files()) {
- append_conf(conf_fh, "#define CHAZ_HAS_SPARSE_FILES\n");
+ 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())
- append_conf(conf_fh, "#define CHAZ_CAN_CREATE_BIG_FILES\n");
+ append_conf("#define CHAZ_CAN_CREATE_BIG_FILES\n");
}
else {
- append_conf(conf_fh, "#define CHAZ_NO_SPARSE_FILES\n");
+ append_conf("#define CHAZ_NO_SPARSE_FILES\n");
}
/* short names */
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm Fri Nov 3 15:53:50 2006
@@ -12,7 +12,7 @@
{
Start_Run(conf_fh, "UnusedVars");
- append_conf(conf_fh,
+ append_conf(
"#define %sUnused_Var(x) ((void)x)\n"
"#define %sUnreachable_Return(type) return (type)0\n",
macro_prefix, macro_prefix
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm?view=diff&rev=471061&r1=471060&r2=471061
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm Fri Nov 3 15:53:50 2006
@@ -45,9 +45,9 @@
if (output != NULL) {
has_varmacros = true;
has_iso_varmacros = true;
- append_conf(conf_fh, "#define %sHAS_VARIADIC_MACROS\n",
+ append_conf("#define %sHAS_VARIADIC_MACROS\n",
constant_prefix);
- append_conf(conf_fh, "#define %sHAS_ISO_VARIADIC_MACROS\n",
+ append_conf("#define %sHAS_ISO_VARIADIC_MACROS\n",
constant_prefix);
}
@@ -57,10 +57,10 @@
has_gnuc_varmacros = true;
if (has_varmacros == false) {
has_varmacros = true;
- append_conf(conf_fh, "#define %sHAS_VARIADIC_MACROS\n",
+ append_conf("#define %sHAS_VARIADIC_MACROS\n",
constant_prefix);
}
- append_conf(conf_fh, "#define %sHAS_GNUC_VARIADIC_MACROS\n",
+ append_conf("#define %sHAS_GNUC_VARIADIC_MACROS\n",
constant_prefix);
}