FAQ

svn commit: r886285 - in /lucene/lucy/trunk: boilerplater/lib/Boilerplater/Binding/Core/ charmonizer/src/Charmonizer/ charmonizer/src/Charmonizer/Core/ charmonizer/src/Charmonizer/Probe/ charmonizer/src/Charmonizer/Test/ core/Lucy/Object/ core/Lucy/Sto...

Marvin
Dec 2, 2009 at 7:38 pm
Author: marvin
Date: Wed Dec 2 19:37:42 2009
New Revision: 886285

URL: http://svn.apache.org/viewvc?rev=886285&view=rev
Log:
Commit LUCY-79, making Lucy C++ compatible and changing MSVC to build in C++
mode by default.

Modified:
lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Core/File.pm
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Defines.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/DirManip.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Floats.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.h
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c
lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.h
lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c
lucene/lucy/trunk/core/Lucy/Object/CharBuf.bp
lucene/lucy/trunk/core/Lucy/Object/Hash.c
lucene/lucy/trunk/core/Lucy/Store/CompoundFileReader.c
lucene/lucy/trunk/core/Lucy/Store/Folder.c
lucene/lucy/trunk/core/Lucy/Store/RAMFileHandle.c
lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c
lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c
lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c
lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c
lucene/lucy/trunk/core/Lucy/Util/SortUtils.c
lucene/lucy/trunk/core/Lucy/Util/ToolSet.h
lucene/lucy/trunk/perl/buildlib/Lucy/Build.pm
lucene/lucy/trunk/perl/lib/Lucy/Object/Hash.pm
lucene/lucy/trunk/perl/lib/Lucy/Object/VTable.pm
lucene/lucy/trunk/perl/xs/Lucy/Object/Err.c
lucene/lucy/trunk/perl/xs/XSBind.c
lucene/lucy/trunk/perl/xs/XSBind.h

Modified: lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Core/File.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Core/File.pm?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Core/File.pm (original)
+++ lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Core/File.pm Wed Dec 2 19:37:42 2009
@@ -60,8 +60,17 @@
$args{header}

$include_guard_start
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
$content

+#ifdef __cplusplus
+}
+#endif
+
$include_guard_close

$args{footer}

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=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c Wed Dec 2 19:37:42 2009
@@ -5,10 +5,9 @@
#include "Charmonizer/Core/Util.h"
#include "Charmonizer/Core/Compiler.h"
#include "Charmonizer/Core/CompilerSpec.h"
+#include "Charmonizer/Core/ModHandler.h"
#include "Charmonizer/Core/OperSys.h"

-extern chaz_bool_t chaz_ModHand_charm_run_available;
-
static void
S_destroy(Compiler *self);

@@ -89,7 +88,7 @@
needed += strlen(self->include_flag) + 2;
needed += strlen(*inc_dirs);
}
- inc_dir_string = malloc(needed + 1);
+ inc_dir_string = (char*)malloc(needed + 1);
inc_dir_string[0] = '\0';
for (inc_dirs = self->inc_dirs; *inc_dirs != NULL; inc_dirs++) {
strcat(inc_dir_string, self->include_flag);
@@ -105,7 +104,7 @@
{
OperSys *os = self->os;
size_t exe_file_buf_size = strlen(exe_name) + strlen(os->exe_ext) + 1;
- char *exe_file = malloc(exe_file_buf_size);
+ char *exe_file = (char*)malloc(exe_file_buf_size);
size_t exe_file_buf_len = sprintf(exe_file, "%s%s", exe_name, os->exe_ext);
char *inc_dir_string = S_inc_dir_string(self);
size_t command_max_size = strlen(os->local_command_start)
@@ -116,7 +115,7 @@
+ strlen(inc_dir_string)
+ strlen(self->cc_flags)
+ 200;
- char *command = malloc(command_max_size);
+ char *command = (char*)malloc(command_max_size);
chaz_bool_t result;
(void)code_len; /* Unused. */

@@ -156,7 +155,7 @@
{
OperSys *os = self->os;
size_t obj_file_buf_size = strlen(obj_name) + strlen(os->obj_ext) + 1;
- char *obj_file = malloc(obj_file_buf_size);
+ char *obj_file = (char*)malloc(obj_file_buf_size);
size_t obj_file_buf_len = sprintf(obj_file, "%s%s", obj_name, os->obj_ext);
char *inc_dir_string = S_inc_dir_string(self);
size_t command_max_size = strlen(os->local_command_start)
@@ -167,7 +166,7 @@
+ strlen(inc_dir_string)
+ strlen(self->cc_flags)
+ 200;
- char *command = malloc(command_max_size);
+ char *command = (char*)malloc(command_max_size);
chaz_bool_t result;
(void)code_len; /* Unused. */

@@ -230,7 +229,7 @@
/* count up the present number of dirs, reallocate */
while (*dirs++ != NULL) { num_dirs++; }
num_dirs += 1; /* passed-in dir */
- self->inc_dirs = realloc(self->inc_dirs, (num_dirs + 1)*sizeof(char*));
+ self->inc_dirs = (char**)realloc(self->inc_dirs, (num_dirs + 1)*sizeof(char*));

/* put the passed-in dir at the end of the list */
self->inc_dirs[num_dirs - 1] = strdup(dir);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_COMPILER
#define H_CHAZ_COMPILER

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stddef.h>
#include "Charmonizer/Core/Defines.h"

@@ -66,6 +70,10 @@
#define CC_new chaz_CC_new
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_COMPILER */

/**

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/CompilerSpec.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_COMPILER_SPEC
#define H_CHAZ_COMPILER_SPEC

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stddef.h>
#include "Charmonizer/Core/Defines.h"

@@ -26,6 +30,10 @@
#define CCSpec_find_spec chaz_CCSpec_find_spec
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_COMPILER_SPEC */

/**

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Defines.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Defines.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Defines.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Defines.h Wed Dec 2 19:37:42 2009
@@ -3,6 +3,10 @@
#ifndef H_CHAZ_DEFINES
#define H_CHAZ_DEFINES 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef int chaz_bool_t;

#ifndef true
@@ -10,5 +14,9 @@
#define false 0
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_DEFINES */


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.c Wed Dec 2 19:37:42 2009
@@ -52,7 +52,7 @@
S_try_init_posix_mkdir(char *header)
{
size_t needed = sizeof(posix_mkdir_code) + 30;
- char *code_buf = malloc(needed);
+ char *code_buf = (char*)malloc(needed);

/* Attempt compilation. */
sprintf(code_buf, posix_mkdir_code, header);
@@ -101,7 +101,7 @@
S_try_init_rmdir(char *header)
{
size_t needed = sizeof(posix_mkdir_code) + 30;
- char *code_buf = malloc(needed);
+ char *code_buf = (char*)malloc(needed);
sprintf(code_buf, rmdir_code, header);
rmdir_available = ModHand_compiler->compile_exe(ModHand_compiler, "_charm_rmdir.c",
"_charm_rmdir", code_buf, strlen(code_buf));

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Dir.h Wed Dec 2 19:37:42 2009
@@ -6,6 +6,10 @@
#ifndef H_CHAZ_DIR
#define H_CHAZ_DIR

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Core/Defines.h"

/* Compile the utilities which execute the Dir_mkdir and Dir_rmdir functions. */
@@ -37,6 +41,10 @@
#define Dir_mkdir_num_args chaz_Dir_mkdir_num_args
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_DIR */

/**

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=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.c Wed Dec 2 19:37:42 2009
@@ -66,8 +66,8 @@
/* 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 = bsearch(&fake, header_cache, cache_size, sizeof(void*),
- S_compare_headers);
+ 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 (header_ptr == NULL) {
@@ -94,7 +94,7 @@
needed += strlen(header_names[i]);
needed += sizeof("#include <>\n");
}
- code_buf = malloc(needed);
+ code_buf = (char*)malloc(needed);
code_buf[0] = '\0';
for (i = 0; header_names[i] != NULL; i++) {
strcat(code_buf, "#include <");
@@ -127,7 +127,7 @@
{
long needed = sizeof(contains_code) + strlen(struct_name)
+ strlen(member) + strlen(includes) + 10;
- char *buf = malloc(needed);
+ char *buf = (char*)malloc(needed);
chaz_bool_t retval;
sprintf(buf, contains_code, includes, struct_name, member);
retval = ModHand_test_compile(buf, strlen(buf));
@@ -188,8 +188,8 @@
/* fake up a key and bsearch for it */
key.name = (char*)header_name;
key.exists = exists;
- header = bsearch(&fake, header_cache, cache_size, sizeof(void*),
- S_compare_headers);
+ 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 */
if (header == NULL) {

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/HeadCheck.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_HEAD_CHECK
#define H_CHAZ_HEAD_CHECK

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Core/Defines.h"

/* Bootstrap the HeadCheck. Call this before anything else.
@@ -36,6 +40,10 @@
#define HeadCheck_check_many_headers chaz_HeadCheck_check_many_headers
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_HEAD_CHECK */

/**

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=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.c Wed Dec 2 19:37:42 2009
@@ -40,12 +40,13 @@
ModHand_init()
{
/* set the name of the application which we "try" to execute */
- try_app_path = malloc(strlen(TRY_APP_BASENAME) + strlen(ModHand_os->exe_ext) + 1);
+ 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 */
- try_app_command = malloc(strlen(ModHand_os->local_command_start) +
- strlen(try_app_path) + 1);
+ 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 */
@@ -163,7 +164,7 @@
+ strlen(ModHand_os->devnull)
+ sizeof(charm_run_code_d)
+ 20;
- char *code = malloc(needed);
+ char *code = (char*)malloc(needed);

sprintf(code, "%s%s \"%s\" %s \"%s\" %s",
charm_run_code_a,
@@ -229,7 +230,7 @@
}

void
-ModHand_append_conf(char *fmt, ...)
+ModHand_append_conf(const char *fmt, ...)
{
va_list args;


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.h Wed Dec 2 19:37:42 2009
@@ -5,6 +5,10 @@
#ifndef H_CHAZ_MOD_HAND
#define H_CHAZ_MOD_HAND 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>
#include <stddef.h>
#include "Charmonizer/Core/Defines.h"
@@ -61,7 +65,7 @@
/* Print output to charmony.h.
*/
void
-chaz_ModHand_append_conf(char *fmt, ...);
+chaz_ModHand_append_conf(const char *fmt, ...);

/* Print bookends delimiting a short names block.
*/
@@ -125,6 +129,10 @@
#define END_RUN CHAZ_MODHAND_END_RUN
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_MOD_HAND */

/**

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=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.c Wed Dec 2 19:37:42 2009
@@ -98,7 +98,7 @@
static void
S_remove_exe(OperSys *self, char *name)
{
- char *exe_name = malloc(strlen(name) + strlen(self->exe_ext) + 1);
+ char *exe_name = (char*)malloc(strlen(name) + strlen(self->exe_ext) + 1);
sprintf(exe_name, "%s%s", name, self->exe_ext);
remove(exe_name);
free(exe_name);
@@ -107,7 +107,7 @@
static void
S_remove_obj(OperSys *self, char *name)
{
- char *obj_name = malloc(strlen(name) + strlen(self->obj_ext) + 1);
+ char *obj_name = (char*)malloc(strlen(name) + strlen(self->obj_ext) + 1);
sprintf(obj_name, "%s%s", name, self->obj_ext);
remove(obj_name);
free(obj_name);
@@ -122,11 +122,11 @@
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);
- command = realloc(command, len + 1);
+ command = (char*)realloc(command, len + 1);
strcat(command, arg);
}
va_end(args);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/OperSys.h Wed Dec 2 19:37:42 2009
@@ -5,6 +5,10 @@
#ifndef H_CHAZ_OPER_SYS
#define H_CHAZ_OPER_SYS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct chaz_OperSys chaz_OperSys;

/* Remove an executable file named [name], appending the exe_ext if needed.
@@ -58,6 +62,10 @@
#define OS_new chaz_OS_new
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_COMPILER */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h Wed Dec 2 19:37:42 2009
@@ -13,6 +13,10 @@
#ifndef H_CHAZ_STAT
#define H_CHAZ_STAT

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Core/Defines.h"

typedef struct chaz_Stat chaz_Stat;
@@ -35,6 +39,10 @@
#define Stat_stat chaz_Stat_stat
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_COMPILER */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Util.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_UTIL
#define H_CHAZ_UTIL 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
@@ -61,6 +65,10 @@
#define Util_can_open_file chaz_Util_can_open_file
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_UTIL */

/**

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe.h Wed Dec 2 19:37:42 2009
@@ -1,6 +1,10 @@
#ifndef H_CHAZ
#define H_CHAZ 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stddef.h>
#include <stdio.h>

@@ -49,6 +53,10 @@
#define Probe_slurp_file chaz_Probe_slurp_file
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* include guard */

/**

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/DirManip.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/DirManip.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/DirManip.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/DirManip.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_DIRMANIP
#define H_CHAZ_DIRMANIP

+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* The DirManip module exports or aliases symbols related to directory and file
* manipulation.
*
@@ -42,6 +46,10 @@
#define DirManip_run chaz_DirManip_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_DIR_SEP */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Floats.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Floats.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Floats.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Floats.h Wed Dec 2 19:37:42 2009
@@ -26,6 +26,10 @@
#ifndef H_CHAZ_FLOATS
#define H_CHAZ_FLOATS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Run the Floats module.
*/
void
@@ -35,6 +39,10 @@
#define Floats_run chaz_Floats_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_FLOATS */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.c Wed Dec 2 19:37:42 2009
@@ -85,7 +85,7 @@

/* write out common defines */
if (has_funcmac) {
- char *macro_text = has_iso_funcmac
+ const char *macro_text = has_iso_funcmac
? "__func__"
: "__FUNCTION__";
ModHand_append_conf(

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/FuncMacro.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_FUNC_MACRO
#define H_CHAZ_FUNC_MACRO

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>

/* Run the FuncMacro module.
@@ -33,6 +37,10 @@
#define FuncMacro_run chaz_FuncMacro_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_FUNC_MACRO */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.c Wed Dec 2 19:37:42 2009
@@ -184,7 +184,7 @@
if (aff_buf_size < len + 1) {
free(aff_buf);
aff_buf_size = len + 1;
- aff_buf = malloc(aff_buf_size);
+ aff_buf = (char*)malloc(aff_buf_size);
}
strcpy(aff_buf, "HAS_");


Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Headers.h Wed Dec 2 19:37:42 2009
@@ -3,6 +3,10 @@

#ifndef H_CHAZ_HEADERS
#define H_CHAZ_HEADERS
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#include <stdio.h>
#include "Charmonizer/Core/Defines.h"

@@ -68,6 +72,10 @@
#define Headers_run chaz_Headers_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_HEADERS */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/Integers.h Wed Dec 2 19:37:42 2009
@@ -96,6 +96,10 @@
#ifndef H_CHAZ_INTEGERS
#define H_CHAZ_INTEGERS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>

/* Run the Integers module.
@@ -106,6 +110,10 @@
#define Integers_run chaz_Integers_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_INTEGERS */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.c Wed Dec 2 19:37:42 2009
@@ -136,7 +136,7 @@
FILE *f;
Charm_Setup;
f = %s("_charm_off64", "w");
- if (f == -1) exit(-1);
+ if (f == NULL) return -1;
printf("%%d", (int)sizeof(%s));
pos = %s(stdout);
%s(stdout, 0, SEEK_SET);
@@ -156,7 +156,7 @@
+ strlen(combo->ftell_command)
+ strlen(combo->fseek_command)
+ 20;
- char *code_buf = malloc(needed);
+ char *code_buf = (char*)malloc(needed);
chaz_bool_t success = false;

/* Prepare the source code. */
@@ -263,7 +263,7 @@
+ strlen(fseek_command)
+ strlen(create_bigfile_code_a)
+ 10;
- char *code_buf = malloc(needed);
+ char *code_buf = (char*)malloc(needed);

/* concat the source strings, compile the file, capture output */
sprintf(code_buf, "%s%s%s", create_bigfile_code_a, fseek_command,

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/LargeFiles.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_LARGE_FILES
#define H_CHAZ_LARGE_FILES

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>

/* The LargeFiles module attempts to detect these symbols or alias them to
@@ -17,7 +21,7 @@
* If the attempt succeeds, this will be defined:
*
* HAS_LARGE_FILE_SUPPORT
- *
+ *
* Use of the off64_t symbol may require sys/types.h.
*/
void chaz_LargeFiles_run(void);
@@ -26,6 +30,10 @@
#define LargeFiles_run chaz_LargeFiles_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_LARGE_FILES */

/**

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/UnusedVars.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_UNUSED_VARS
#define H_CHAZ_UNUSED_VARS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>

/* Run the UnusedVars module.
@@ -20,6 +24,10 @@
#define UnusedVars_run chaz_UnusedVars_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_UNUSED_VARS */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Probe/VariadicMacros.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_VARIADIC_MACROS
#define H_CHAZ_VARIADIC_MACROS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>

/* Run the VariadicMacros module.
@@ -26,6 +30,10 @@
#define VariadicMacros_run chaz_VariadicMacros_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_VARIADIC_MACROS */



Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_TEST
#define H_CHAZ_TEST

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Core/Defines.h"

typedef struct chaz_TestBatch chaz_TestBatch;
@@ -144,6 +148,10 @@
#define SKIP_REMAINING CHAZ_TEST_SKIP_REMAINING
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_TEST */



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=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.c Wed Dec 2 19:37:42 2009
@@ -12,7 +12,7 @@
Test_init();

/* create a null-terminated array of test batches to iterate over */
- batches = malloc(8 * sizeof(TestBatch*));
+ batches = (TestBatch**)malloc(8 * sizeof(TestBatch*));
batches[0] = TDirManip_prepare();
batches[1] = TFuncMacro_prepare();
batches[2] = THeaders_prepare();

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.h (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/AllTests.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_CHAZ_ALL_TESTS
#define H_CHAZ_ALL_TESTS

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Test.h"

/* Initialize the AllTests module.
@@ -88,6 +92,10 @@
#define TVariadicMacros_run chaz_TVariadicMacros_run
#endif

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_TEST */



Modified: lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/ByteBuf.c Wed Dec 2 19:37:42 2009
@@ -49,7 +49,7 @@
BB_new_steal_bytes(void *bytes, size_t size, size_t capacity)
{
ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
- self->buf = bytes;
+ self->buf = (char*)bytes;
self->size = size;
self->cap = capacity;
return self;

Modified: lucene/lucy/trunk/core/Lucy/Object/CharBuf.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/CharBuf.bp?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/CharBuf.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Object/CharBuf.bp Wed Dec 2 19:37:42 2009
@@ -339,6 +339,7 @@

extern lucy_ZombieCharBuf LUCY_ZCB_EMPTY;

+#ifdef C_LUCY_ZOMBIECHARBUF
/* Simple functions which allows assignment idiom for ZombieCharBuf values.
*/
lucy_ZombieCharBuf
@@ -346,6 +347,7 @@

lucy_ZombieCharBuf
lucy_ZCB_make(const lucy_CharBuf *source);
+#endif /* C_LUCY_ZOMBIECHARBUF */

#ifdef LUCY_USE_SHORT_NAMES
#define ZCB_BLANK LUCY_ZCB_BLANK

Modified: lucene/lucy/trunk/core/Lucy/Object/Hash.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Hash.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Hash.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Hash.c Wed Dec 2 19:37:42 2009
@@ -415,7 +415,7 @@

FREEMEM(old_entries);

- return self->entries;
+ return (HashEntry*)self->entries;
}

/* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/core/Lucy/Store/CompoundFileReader.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Store/CompoundFileReader.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Store/CompoundFileReader.c (original)
+++ lucene/lucy/trunk/core/Lucy/Store/CompoundFileReader.c Wed Dec 2 19:37:42 2009
@@ -36,7 +36,7 @@
}
else {
Obj *format = Hash_Fetch_Str(metadata, "format", 6);
- self->format = format ? Obj_To_I64(format) : 0;
+ self->format = format ? (i32_t)Obj_To_I64(format) : 0;
self->records = (Hash*)INCREF(Hash_Fetch_Str(metadata, "files", 5));
if (self->format < 1) {
error = Err_new(CB_newf(

Modified: lucene/lucy/trunk/core/Lucy/Store/Folder.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Store/Folder.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Store/Folder.c (original)
+++ lucene/lucy/trunk/core/Lucy/Store/Folder.c Wed Dec 2 19:37:42 2009
@@ -338,15 +338,17 @@
RETHROW(INCREF(Err_get_error()));
}
else {
- u64_t size = InStream_Length(instream);
+ u64_t length = InStream_Length(instream);

- if (size > SIZE_MAX) {
+ if (length >= SIZE_MAX) {
InStream_Close(instream);
DECREF(instream);
- THROW(ERR, "File %o is too big to slurp (%u64 bytes)", path, size);
+ THROW(ERR, "File %o is too big to slurp (%u64 bytes)", path,
+ length);
}
else {
- char *ptr = (char*)MALLOCATE(size + 1);
+ size_t size = (size_t)length;
+ char *ptr = (char*)MALLOCATE((size_t)size + 1);
InStream_Read_Bytes(instream, ptr, size);
ptr[size] = '\0';
retval = BB_new_steal_bytes(ptr, size, size + 1);

Modified: lucene/lucy/trunk/core/Lucy/Store/RAMFileHandle.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Store/RAMFileHandle.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Store/RAMFileHandle.c (original)
+++ lucene/lucy/trunk/core/Lucy/Store/RAMFileHandle.c Wed Dec 2 19:37:42 2009
@@ -152,7 +152,7 @@
return false;
}
else {
- BB_Grow(self->ram_file->contents, len);
+ BB_Grow(self->ram_file->contents, (size_t)len);
return true;
}
}

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestIOChunks.c Wed Dec 2 19:37:42 2009
@@ -66,9 +66,10 @@
"Requesting over limit triggers refill");

{
- size_t expected = InStream_Length(instream) - InStream_Tell(instream);
- buf = InStream_Buf(instream, 100000);
- ASSERT_INT_EQ(batch, instream->limit - buf, expected,
+ i64_t expected = InStream_Length(instream) - InStream_Tell(instream);
+ char *buff = InStream_Buf(instream, 100000);
+ i64_t got = PTR2I64(instream->limit) - PTR2I64(buff);
+ ASSERT_TRUE(batch, got == expected,
"Requests greater than file size get pared down");
}


Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestIOPrimitives.c Wed Dec 2 19:37:42 2009
@@ -336,7 +336,7 @@

/* Truncate. */
for (i = 0; i < 1000; i++) {
- values[i] = f64s[i];
+ values[i] = (float)f64s[i];
}

/* Test boundaries. */

Modified: lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Store/TestInStream.c Wed Dec 2 19:37:42 2009
@@ -156,7 +156,7 @@
ASSERT_TRUE(batch, instream->window->offset == gb6,
"Seek forwards outside buffer tracks pos in window offset");

- InStream_Buf(instream, gb1);
+ InStream_Buf(instream, (size_t)gb1);
ASSERT_TRUE(batch, instream->limit == ((char*)NULL) + gb1,
"InStream_Buf sets limit");


Modified: lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c (original)
+++ lucene/lucy/trunk/core/Lucy/Test/Util/TestNumberUtils.c Wed Dec 2 19:37:42 2009
@@ -21,7 +21,8 @@
if (ints[i]) { NumUtil_u1set(bits, i); }
}
for (i = 0; i < count; i++) {
- ASSERT_INT_EQ(batch, NumUtil_u1get(bits, i), ints[i], "u1 set/get");
+ ASSERT_INT_EQ(batch, NumUtil_u1get(bits, i), (long)ints[i],
+ "u1 set/get");
}

for (i = 0; i < count; i++) {
@@ -44,10 +45,10 @@
size_t i;

for (i = 0; i < count; i++) {
- NumUtil_u2set(bits, i, ints[i]);
+ NumUtil_u2set(bits, i, (u8_t)ints[i]);
}
for (i = 0; i < count; i++) {
- ASSERT_INT_EQ(batch, NumUtil_u2get(bits, i), ints[i], "u2");
+ ASSERT_INT_EQ(batch, NumUtil_u2get(bits, i), (long)ints[i], "u2");
}

FREEMEM(bits);
@@ -63,10 +64,10 @@
size_t i;

for (i = 0; i < count; i++) {
- NumUtil_u4set(bits, i, ints[i]);
+ NumUtil_u4set(bits, i, (u8_t)ints[i]);
}
for (i = 0; i < count; i++) {
- ASSERT_INT_EQ(batch, NumUtil_u4get(bits, i), ints[i], "u4");
+ ASSERT_INT_EQ(batch, NumUtil_u4get(bits, i), (long)ints[i], "u4");
}

FREEMEM(bits);
@@ -94,7 +95,7 @@
mins[set_num], limits[set_num]);
target = encoded;
for (i = 0; i < count; i++) {
- NumUtil_encode_c32(ints[i], &target);
+ NumUtil_encode_c32((u32_t)ints[i], &target);
}
target = encoded;
skip = encoded;
@@ -109,7 +110,7 @@

target = encoded;
for (i = 0; i < count; i++) {
- NumUtil_encode_padded_c32(ints[i], &target);
+ NumUtil_encode_padded_c32((u32_t)ints[i], &target);
}
ASSERT_TRUE(batch, target == limit,
"padded c32 uses 5 bytes (%lu == %lu)", (unsigned long)target,
@@ -195,13 +196,13 @@
size_t i;

for (i = 0; i < count; i++) {
- NumUtil_encode_bigend_u16(ints[i], &target);
+ NumUtil_encode_bigend_u16((u16_t)ints[i], &target);
target += sizeof(u16_t);
}
target = encoded;
for (i = 0; i < count; i++) {
u16_t got = NumUtil_decode_bigend_u16(target);
- ASSERT_INT_EQ(batch, got, ints[i], "bigend u16");
+ ASSERT_INT_EQ(batch, got, (long)ints[i], "bigend u16");
target += sizeof(u16_t);
}

@@ -226,13 +227,13 @@
size_t i;

for (i = 0; i < count; i++) {
- NumUtil_encode_bigend_u32(ints[i], &target);
+ NumUtil_encode_bigend_u32((u32_t)ints[i], &target);
target += sizeof(u32_t);
}
target = encoded;
for (i = 0; i < count; i++) {
u32_t got = NumUtil_decode_bigend_u32(target);
- ASSERT_INT_EQ(batch, got, ints[i], "bigend u32");
+ ASSERT_INT_EQ(batch, got, (long)ints[i], "bigend u32");
target += sizeof(u32_t);
}


Modified: lucene/lucy/trunk/core/Lucy/Util/SortUtils.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/SortUtils.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/SortUtils.c (original)
+++ lucene/lucy/trunk/core/Lucy/Util/SortUtils.c Wed Dec 2 19:37:42 2009
@@ -50,10 +50,12 @@

/* Dispatch by element size. */
if (width == 4) {
- S_msort4(elems, scratch, 0, num_elems - 1, compare, context);
+ S_msort4((FOUR_BYTE_TYPE*)elems, (FOUR_BYTE_TYPE*)scratch,
+ 0, num_elems - 1, compare, context);
}
else if (width == 8) {
- S_msort8(elems, scratch, 0, num_elems - 1, compare, context);
+ S_msort8((EIGHT_BYTE_TYPE*)elems, (EIGHT_BYTE_TYPE*)scratch,
+ 0, num_elems - 1, compare, context);
}
else {
THROW(ERR, "Can't sort elements which are %u32 bytes", width);
@@ -65,8 +67,9 @@
void *right_ptr, u32_t right_size,
void *dest, Sort_compare_t compare, void *context)
{
- SI_merge4(left_ptr, left_size, right_ptr, right_size, dest, compare,
- context);
+ SI_merge4((FOUR_BYTE_TYPE*)left_ptr, left_size,
+ (FOUR_BYTE_TYPE*)right_ptr, right_size,
+ (FOUR_BYTE_TYPE*)dest, compare, context);
}

void
@@ -74,8 +77,9 @@
void *right_ptr, u32_t right_size,
void *dest, Sort_compare_t compare, void *context)
{
- SI_merge8(left_ptr, left_size, right_ptr, right_size, dest, compare,
- context);
+ SI_merge8((EIGHT_BYTE_TYPE*)left_ptr, left_size,
+ (EIGHT_BYTE_TYPE*)right_ptr, right_size,
+ (EIGHT_BYTE_TYPE*)dest, compare, context);
}

static void
@@ -215,10 +219,10 @@
}

if (width == 4) {
- S_qsort4(elems, 0, num_elems - 1, compare, context);
+ S_qsort4((FOUR_BYTE_TYPE*)elems, 0, num_elems - 1, compare, context);
}
else if (width == 8) {
- S_qsort8(elems, 0, num_elems - 1, compare, context);
+ S_qsort8((EIGHT_BYTE_TYPE*)elems, 0, num_elems - 1, compare, context);
}
else {
THROW(ERR, "Unsupported width: %i64", (i64_t)width);

Modified: lucene/lucy/trunk/core/Lucy/Util/ToolSet.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/ToolSet.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/ToolSet.h (original)
+++ lucene/lucy/trunk/core/Lucy/Util/ToolSet.h Wed Dec 2 19:37:42 2009
@@ -1,6 +1,10 @@
#ifndef H_LUCY_TOOLSET
#define H_LUCY_TOOLSET 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* ToolSet groups together several commonly used header files, so that only
* one pound-include directive is needed for them.
*
@@ -32,6 +36,10 @@
#include "Lucy/Util/Memory.h"
#include "Lucy/Util/StringHelper.h"

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_LUCY_TOOLSET */

/* Copyright 2009 The Apache Software Foundation

Modified: lucene/lucy/trunk/perl/buildlib/Lucy/Build.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/buildlib/Lucy/Build.pm?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/buildlib/Lucy/Build.pm (original)
+++ lucene/lucy/trunk/perl/buildlib/Lucy/Build.pm Wed Dec 2 19:37:42 2009
@@ -66,6 +66,11 @@
}
}

+ # Compile as C++ under MSVC.
+ if ( $Config{cc} eq 'cl' ) {
+ $extra_ccflags .= '/TP ';
+ }
+
return $extra_ccflags;
}


Modified: lucene/lucy/trunk/perl/lib/Lucy/Object/Hash.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Object/Hash.pm?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Object/Hash.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Object/Hash.pm Wed Dec 2 19:37:42 2009
@@ -37,8 +37,8 @@
lucy_Obj *val;

if (Lucy_Hash_Iter_Next(self, &key, &val)) {
- SV *key_sv = Lucy_Obj_To_Host(key);
- SV *val_sv = Lucy_Obj_To_Host(val);
+ SV *key_sv = (SV*)Lucy_Obj_To_Host(key);
+ SV *val_sv = (SV*)Lucy_Obj_To_Host(val);

XPUSHs(sv_2mortal( key_sv ));
XPUSHs(sv_2mortal( val_sv ));

Modified: lucene/lucy/trunk/perl/lib/Lucy/Object/VTable.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Object/VTable.pm?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Object/VTable.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Object/VTable.pm Wed Dec 2 19:37:42 2009
@@ -14,7 +14,7 @@
CODE:
if (lucy_VTable_registry == NULL)
lucy_VTable_init_registry();
- RETVAL = Lucy_Obj_To_Host(lucy_VTable_registry);
+ RETVAL = (SV*)Lucy_Obj_To_Host(lucy_VTable_registry);
OUTPUT: RETVAL
END_XS_CODE


Modified: lucene/lucy/trunk/perl/xs/Lucy/Object/Err.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/xs/Lucy/Object/Err.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/xs/Lucy/Object/Err.c (original)
+++ lucene/lucy/trunk/perl/xs/Lucy/Object/Err.c Wed Dec 2 19:37:42 2009
@@ -39,7 +39,7 @@
{
lucy_Err_to_host_t super_to_host
= (lucy_Err_to_host_t)LUCY_SUPER_METHOD(LUCY_ERR, Err, To_Host);
- SV *perl_obj = super_to_host(self);
+ SV *perl_obj = (SV*)super_to_host(self);
XSBind_enable_overload(perl_obj);
return perl_obj;
}

Modified: lucene/lucy/trunk/perl/xs/XSBind.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/xs/XSBind.c?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/xs/XSBind.c (original)
+++ lucene/lucy/trunk/perl/xs/XSBind.c Wed Dec 2 19:37:42 2009
@@ -105,7 +105,7 @@
/* Mortalize the converted object -- which is somewhat
* dangerous, but is the only way to avoid requiring that the
* caller take responsibility for a refcount. */
- SV *mortal = Lucy_Obj_To_Host(retval);
+ SV *mortal = (SV*)Lucy_Obj_To_Host(retval);
LUCY_DECREF(retval);
sv_2mortal(mortal);
}

Modified: lucene/lucy/trunk/perl/xs/XSBind.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/xs/XSBind.h?rev=886285&r1=886284&r2=886285&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/xs/XSBind.h (original)
+++ lucene/lucy/trunk/perl/xs/XSBind.h Wed Dec 2 19:37:42 2009
@@ -4,6 +4,10 @@
#ifndef H_LUCY_XSBIND
#define H_LUCY_XSBIND 1

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "charmony.h"
#include "Lucy/Object/Obj.h"
#include "Lucy/Object/ByteBuf.h"
@@ -64,7 +68,7 @@
static CHY_INLINE SV*
lucy_XSBind_lucy_obj_to_sv(lucy_Obj *obj)
{
- return obj ? Lucy_Obj_To_Host(obj) : newSV(0);
+ return obj ? (SV*)Lucy_Obj_To_Host(obj) : newSV(0);
}

/** XSBind_lucy_obj_to_sv, with a cast.
@@ -80,7 +84,7 @@
{
SV *retval;
if (obj) {
- retval = Lucy_Obj_To_Host(obj);
+ retval = (SV*)Lucy_Obj_To_Host(obj);
Lucy_Obj_Dec_RefCount(obj);
}
else {
@@ -176,6 +180,10 @@
#define WARN LUCY_WARN
#define OVERRIDDEN LUCY_OVERRIDDEN

+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_LUCY_XSBIND */

/**
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Marvin: 1 post