[PATCH libreoffice-4-0] jvmfwk: de-Pascalize do_msvcr71_magic
Michael Stahl (via Code Review)
gerrit at gerrit.libreoffice.org
Sun Jun 2 11:50:30 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4135
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/35/4135/1
jvmfwk: de-Pascalize do_msvcr71_magic
The uninitialized Module variable causes the smoketest to fail when
built with MSVC 2012 (assinging to it raises some weird exception).
Change-Id: I77b3b591a94f4dfbb373938e3787f75e6a8e09c5
(cherry picked from commit 1ff01d207d90685cb897f518c2a688b5ef33358e)
---
M jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index fbc4eeb9..33db97d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -488,20 +488,15 @@
// and just let the implicit loading try to take care of it.
static void do_msvcr71_magic(rtl_uString *jvm_dll)
{
- FILE *f;
- rtl_uString* Module;
- oslFileError nError;
+ rtl_uString* Module(0);
struct stat st;
- PIMAGE_DOS_HEADER dos_hdr;
- IMAGE_NT_HEADERS *nt_hdr;
- IMAGE_IMPORT_DESCRIPTOR *imports;
- nError = osl_getSystemPathFromFileURL(jvm_dll, &Module);
+ oslFileError nError = osl_getSystemPathFromFileURL(jvm_dll, &Module);
if ( osl_File_E_None != nError )
rtl_uString_assign(&Module, jvm_dll);
- f = _wfopen(reinterpret_cast<LPCWSTR>(Module->buffer), L"rb");
+ FILE *f = _wfopen(reinterpret_cast<LPCWSTR>(Module->buffer), L"rb");
if (fstat(fileno(f), &st) == -1)
{
@@ -509,7 +504,7 @@
return;
}
- dos_hdr = (PIMAGE_DOS_HEADER) malloc(st.st_size);
+ PIMAGE_DOS_HEADER dos_hdr = (PIMAGE_DOS_HEADER) malloc(st.st_size);
if (fread(dos_hdr, st.st_size, 1, f) != 1 ||
memcmp(dos_hdr, "MZ", 2) != 0 ||
@@ -523,9 +518,10 @@
fclose(f);
- nt_hdr = (IMAGE_NT_HEADERS *) ((char *)dos_hdr + dos_hdr->e_lfanew);
+ IMAGE_NT_HEADERS *nt_hdr = (IMAGE_NT_HEADERS *) ((char *)dos_hdr + dos_hdr->e_lfanew);
- imports = (IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + nt_hdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+ IMAGE_IMPORT_DESCRIPTOR *imports =
+ (IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + nt_hdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
while (imports <= (IMAGE_IMPORT_DESCRIPTOR *) ((char *) dos_hdr + st.st_size - sizeof (IMAGE_IMPORT_DESCRIPTOR)) &&
imports->Name != 0 &&
--
To view, visit https://gerrit.libreoffice.org/4135
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77b3b591a94f4dfbb373938e3787f75e6a8e09c5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Michael Stahl <mstahl at redhat.com>
More information about the LibreOffice
mailing list