Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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@redhat.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.