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:36:01 UTC
svn commit: r471055 - in /lucene/lucy/trunk/charmonizer/src/Charmonizer: ./
Core/ Probe/
Author: marvin
Date: Fri Nov 3 15:36:00 2006
New Revision: 471055
URL: http://svn.apache.org/viewvc?view=rev&rev=471055
Log:
Save the conf_fh in a global variable. Remove it as an argument from all the
shorten_xxxx functions.
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.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/Probe/UnusedVars.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm Fri Nov 3 15:36:00 2006
@@ -30,6 +30,7 @@
struct chaz_Compiler *chaz_ModHand_compiler = NULL;
chaz_bool_t chaz_ModHand_charm_run_available = false;
FILE* chaz_ModHand_charm_test_h_fh = NULL;
+FILE* chaz_ModHand_conf_fh = NULL;
chaz_bool_t chaz_ModHand_want_charm_test_h = false;
char *constant_prefix = NULL;
@@ -208,27 +209,31 @@
}
void
-chaz_ModHand_shorten_constant(FILE *conf_fh, const char *sym)
+chaz_ModHand_shorten_constant(const char *sym)
{
- append_conf(conf_fh, "# define %s %s%s\n", sym, constant_prefix, sym);
+ append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
+ sym, constant_prefix, sym);
}
void
-chaz_ModHand_shorten_macro(FILE *conf_fh, const char *sym)
+chaz_ModHand_shorten_macro(const char *sym)
{
- append_conf(conf_fh, "# define %s %s%s\n", sym, macro_prefix, sym);
+ append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
+ sym, macro_prefix, sym);
}
void
-chaz_ModHand_shorten_typedef(FILE *conf_fh, const char *sym)
+chaz_ModHand_shorten_typedef(const char *sym)
{
- append_conf(conf_fh, "# define %s %s%s\n", sym, typedef_prefix, sym);
+ append_conf(chaz_ModHand_conf_fh, "# define %s %s%s\n",
+ sym, typedef_prefix, sym);
}
void
-chaz_ModHand_shorten_function(FILE *conf_fh, const char *sym)
+chaz_ModHand_shorten_function(const char *sym)
{
- append_conf(conf_fh, "# define %s %s%s\n", sym, function_prefix, sym);
+ append_conf(chaz_ModHand_conf_fh, "# 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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.harm Fri Nov 3 15:36:00 2006
@@ -23,6 +23,7 @@
extern struct chaz_Compiler *chaz_ModHand_compiler;
extern chaz_bool_t chaz_ModHand_charm_run_available;
extern FILE* chaz_ModHand_charm_test_h_fh;
+extern FILE* chaz_ModHand_conf_fh;
extern chaz_bool_t chaz_ModHand_want_charm_test_h;
extern char *chaz_ModHand_constant_prefix;
@@ -73,22 +74,22 @@
/* Define a shortened version of a constant symbol (minus the prefix);
*/
void
-chaz_ModHand_shorten_constant(FILE *conf_fh, const char *symbol);
+chaz_ModHand_shorten_constant(const char *symbol);
/* Define a shortened version of a macro symbol (minuse the prefix);
*/
void
-chaz_ModHand_shorten_macro(FILE *conf_fh, const char *symbol);
+chaz_ModHand_shorten_macro(const char *symbol);
/* Define a shortened version of a typedef symbol (minuse the prefix);
*/
void
-chaz_ModHand_shorten_typedef(FILE *conf_fh, const char *symbol);
+chaz_ModHand_shorten_typedef(const char *symbol);
/* Define a shortened version of a function symbol (minuse the prefix);
*/
void
-chaz_ModHand_shorten_function(FILE *conf_fh, const char *symbol);
+chaz_ModHand_shorten_function(const char *symbol);
/* Signal Charmonizer that it should write _charm_test.h.
*/
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.charm?view=diff&rev=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.charm Fri Nov 3 15:36:00 2006
@@ -14,7 +14,7 @@
chaz_Probe_init(FILE *conf_fh, const char *osname, const char *cc_command,
const char *cc_flags)
{
- (void)conf_fh; /* unused for now */
+ chaz_ModHand_conf_fh = conf_fh;
/* create os and compiler objects */
os = OS_new(osname);
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.charm Fri Nov 3 15:36:00 2006
@@ -80,12 +80,12 @@
if (want_short_names) {
Start_Short_Names(conf_fh);
if (has_iso_funcmac)
- shorten_constant(conf_fh, "HAS_ISO_FUNC_MACRO");
+ shorten_constant("HAS_ISO_FUNC_MACRO");
if (has_gnuc_funcmac)
- shorten_constant(conf_fh, "HAS_GNUC_FUNC_MACRO");
+ shorten_constant("HAS_GNUC_FUNC_MACRO");
if (has_iso_funcmac || has_gnuc_funcmac) {
- shorten_constant(conf_fh, "HAS_FUNC_MACRO");
- shorten_macro(conf_fh, "Func_Macro");
+ shorten_constant("HAS_FUNC_MACRO");
+ shorten_macro("Func_Macro");
}
End_Short_Names(conf_fh);
}
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.charm Fri Nov 3 15:36:00 2006
@@ -108,16 +108,16 @@
Start_Short_Names(conf_fh);
if (has_posix)
- shorten_constant(conf_fh, "HAS_POSIX");
+ shorten_constant("HAS_POSIX");
if (has_c89) {
- shorten_constant(conf_fh, "HAS_C89");
- shorten_constant(conf_fh, "HAS_C90");
+ shorten_constant("HAS_C89");
+ shorten_constant("HAS_C90");
}
for (i = 0; keepers[i] != NULL; i++) {
encode_affirmation(keepers[i]);
- shorten_constant(conf_fh, aff_buf);
+ shorten_constant(aff_buf);
}
End_Short_Names(conf_fh);
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.charm Fri Nov 3 15:36:00 2006
@@ -357,68 +357,68 @@
Start_Short_Names(conf_fh);
if (machine_is_big_endian())
- shorten_constant(conf_fh, "BIG_END");
+ shorten_constant("BIG_END");
else
- shorten_constant(conf_fh, "LITTLE_END");
+ shorten_constant("LITTLE_END");
- shorten_constant(conf_fh, "SIZEOF_CHAR");
- shorten_constant(conf_fh, "SIZEOF_SHORT");
- shorten_constant(conf_fh, "SIZEOF_LONG");
- shorten_constant(conf_fh, "SIZEOF_INT");
- shorten_constant(conf_fh, "SIZEOF_PTR");
+ shorten_constant("SIZEOF_CHAR");
+ shorten_constant("SIZEOF_SHORT");
+ shorten_constant("SIZEOF_LONG");
+ shorten_constant("SIZEOF_INT");
+ shorten_constant("SIZEOF_PTR");
if (has_long_long) {
- shorten_constant(conf_fh, "HAS_LONG_LONG");
- shorten_constant(conf_fh, "SIZEOF_LONG_LONG");
+ shorten_constant("HAS_LONG_LONG");
+ shorten_constant("SIZEOF_LONG_LONG");
}
if (has___int64) {
- shorten_constant(conf_fh, "HAS___INT64");
- shorten_constant(conf_fh, "SIZEOF___INT64");
+ shorten_constant("HAS___INT64");
+ shorten_constant("SIZEOF___INT64");
}
if (has_inttypes)
- shorten_constant(conf_fh, "HAS_INTTYPES_H");
+ shorten_constant("HAS_INTTYPES_H");
- shorten_typedef(conf_fh, "bool_t");
+ shorten_typedef("bool_t");
if (has_8) {
- shorten_constant(conf_fh, "HAS_I8_T");
- shorten_typedef(conf_fh, "i8_t");
- shorten_typedef(conf_fh, "u8_t");
- shorten_constant(conf_fh, "I8_MAX");
- shorten_constant(conf_fh, "I8_MIN");
- shorten_constant(conf_fh, "U8_MAX");
+ shorten_constant("HAS_I8_T");
+ shorten_typedef("i8_t");
+ shorten_typedef("u8_t");
+ shorten_constant("I8_MAX");
+ shorten_constant("I8_MIN");
+ shorten_constant("U8_MAX");
}
if (has_16) {
- shorten_constant(conf_fh, "HAS_I16_T");
- shorten_typedef(conf_fh, "i16_t");
- shorten_typedef(conf_fh, "u16_t");
- shorten_constant(conf_fh, "I16_MAX");
- shorten_constant(conf_fh, "I16_MIN");
- shorten_constant(conf_fh, "U16_MAX");
+ shorten_constant("HAS_I16_T");
+ shorten_typedef("i16_t");
+ shorten_typedef("u16_t");
+ shorten_constant("I16_MAX");
+ shorten_constant("I16_MIN");
+ shorten_constant("U16_MAX");
}
if (has_32) {
- shorten_constant(conf_fh, "HAS_I32_T");
- shorten_typedef(conf_fh, "i32_t");
- shorten_typedef(conf_fh, "u32_t");
- shorten_constant(conf_fh, "I32_MAX");
- shorten_constant(conf_fh, "I32_MIN");
- shorten_constant(conf_fh, "U32_MAX");
- shorten_macro(conf_fh, "I32_C");
- shorten_macro(conf_fh, "U32_C");
+ shorten_constant("HAS_I32_T");
+ shorten_typedef("i32_t");
+ shorten_typedef("u32_t");
+ shorten_constant("I32_MAX");
+ shorten_constant("I32_MIN");
+ shorten_constant("U32_MAX");
+ shorten_macro("I32_C");
+ shorten_macro("U32_C");
}
if (has_64) {
- shorten_constant(conf_fh, "HAS_I64_T");
- shorten_typedef(conf_fh, "i64_t");
- shorten_typedef(conf_fh, "u64_t");
- shorten_constant(conf_fh, "I64_MAX");
- shorten_constant(conf_fh, "I64_MIN");
- shorten_constant(conf_fh, "U64_MAX");
- shorten_macro(conf_fh, "I64P");
- shorten_macro(conf_fh, "U64P");
- shorten_macro(conf_fh, "I64_C");
- shorten_macro(conf_fh, "U64_C");
+ shorten_constant("HAS_I64_T");
+ shorten_typedef("i64_t");
+ shorten_typedef("u64_t");
+ shorten_constant("I64_MAX");
+ shorten_constant("I64_MIN");
+ shorten_constant("U64_MAX");
+ shorten_macro("I64P");
+ shorten_macro("U64P");
+ shorten_macro("I64_C");
+ shorten_macro("U64_C");
}
End_Short_Names(conf_fh);
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.charm Fri Nov 3 15:36:00 2006
@@ -103,13 +103,13 @@
/* short names */
if (want_short_names && success) {
Start_Short_Names(conf_fh);
- shorten_constant(conf_fh, "HAS_LARGE_FILE_SUPPORT");
+ shorten_constant("HAS_LARGE_FILE_SUPPORT");
/* alias these only if they're not already provided and correct */
if (strcmp(loff_type, "off64_t") != 0) {
- shorten_constant(conf_fh, "off64_t");
- shorten_function(conf_fh, "ftello64");
- shorten_function(conf_fh, "fseeko64");
+ shorten_constant("off64_t");
+ shorten_function("ftello64");
+ shorten_function("fseeko64");
}
End_Short_Names(conf_fh);
}
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.charm Fri Nov 3 15:36:00 2006
@@ -20,8 +20,8 @@
if (want_short_names) {
Start_Short_Names(conf_fh);
- shorten_macro(conf_fh, "Unused_Var");
- shorten_macro(conf_fh, "Unreachable_Return");
+ shorten_macro("Unused_Var");
+ shorten_macro("Unreachable_Return");
End_Short_Names(conf_fh);
}
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=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.charm Fri Nov 3 15:36:00 2006
@@ -67,11 +67,11 @@
if (want_short_names) {
Start_Short_Names(conf_fh);
if (has_varmacros)
- shorten_constant(conf_fh, "HAS_VARIADIC_MACROS");
+ shorten_constant("HAS_VARIADIC_MACROS");
if (has_iso_varmacros)
- shorten_constant(conf_fh, "HAS_ISO_VARIADIC_MACROS");
+ shorten_constant("HAS_ISO_VARIADIC_MACROS");
if (has_gnuc_varmacros)
- shorten_constant(conf_fh, "HAS_GNUC_VARIADIC_MACROS");
+ shorten_constant("HAS_GNUC_VARIADIC_MACROS");
End_Short_Names(conf_fh);
}
Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm?view=diff&rev=471055&r1=471054&r2=471055
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.harm Fri Nov 3 15:36:00 2006
@@ -25,10 +25,10 @@
chaz_TestBatch*
chaz_Test_new_batch(unsigned num_tests);
-/* These tests all require the file _charm_test.h. See the documentation for
+/* These tests all require the file charmony.h. See the documentation for
* Charmonizer/Probe.h for instructions on how to produce it.
*
- * No other header files should be included other than _charm_test.h and this
+ * No other header files should be included other than charmony.h and this
* one.
*
* Since Charmonizer conditionally defines many symbols, it can be difficult