scaddins/source/analysis/analysis.cxx |   53 ++++++++++++----------------------
 set_soenv.in                          |    2 -
 solenv/inc/_tg_def.mk                 |   20 ++++++------
 solenv/inc/svpm.h                     |    3 +
 solenv/inc/tg_def.mk                  |    2 -
 vcl/Library_vcl.mk                    |    6 +++
 vcl/inc/os2/salframe.h                |    4 --
 vcl/os2/source/window/salframe.cxx    |    1 
 xmlsecurity/util/makefile.mk          |    3 +
 9 files changed, 44 insertions(+), 50 deletions(-)

New commits:
commit 6582a1533b06bac95f4ac1511c563102664e81a9
Author: Pedro Giffuni <p...@apache.org>
Date:   Mon Sep 14 16:41:03 2015 +0000

    Replace the random generator in RANDBETWEEN()
    
    For consistency with RAND(), replace the old Wichman-Hill with
    an even older version of George Marsaglia's KISS algorithm.
    
    For the intended use this is more than enough and
    still should pass all statistics tests.

diff --git a/scaddins/source/analysis/analysis.cxx 
b/scaddins/source/analysis/analysis.cxx
index 005b021..0300583 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -805,11 +805,14 @@ double SAL_CALL AnalysisAddIn::getSqrtpi( double fNum ) 
THROWDEF_RTE_IAE
     RETURN_FINITE( fRet );
 }
 
+#define SCRANDOMQ_SIZE 4
 
 double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) 
THROWDEF_RTE_IAE
 {
-    static sal_Int32 nScRandomIx = 0, nScRandomIy = 0, nScRandomIz = 0, 
nScRandomIt = 0;
+    static sal_uInt32 nScRandomSeed[SCRANDOMQ_SIZE];
+    static sal_Bool SqSeeded = sal_False;
     static rtlRandomPool aPool = rtl_random_createPool();
+    sal_uInt64 nScRandomt, nScRandoma = 698769069LL;
     double fScRandomW;
 
     fMin = ::rtl::math::round( fMin, 0, rtl_math_RoundingMode_Up );
@@ -817,43 +820,25 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double 
fMin, double fMax ) THROWD
     if( fMin > fMax )
         THROW_IAE;
 
-    // Seeding for the PRNG: should be good enough but we
-    // monitor the values to keep things under control.
-    if (nScRandomIx <= 0)
-    rtl_random_getBytes(aPool, &nScRandomIx, sizeof(nScRandomIx));
-    if (nScRandomIy <= 0)
-    rtl_random_getBytes(aPool, &nScRandomIy, sizeof(nScRandomIy));
-    if (nScRandomIz <= 0)
-    rtl_random_getBytes(aPool, &nScRandomIz, sizeof(nScRandomIz));
-    if (nScRandomIt <= 0)
-    rtl_random_getBytes(aPool, &nScRandomIt, sizeof(nScRandomIt));
-
-    // Basically unmodified algorithm from
-    // Wichman and Hill, "Generating good pseudo-random numbers",
-    //      December 5, 2005.
-
-    nScRandomIx = 11600L * (nScRandomIx % 185127L) - 10379L * (nScRandomIx / 
185127L);
-    nScRandomIy = 47003L * (nScRandomIy %  45688L) - 10479L * (nScRandomIy /  
45688L);
-    nScRandomIz = 23000L * (nScRandomIz %  93368L) - 19423L * (nScRandomIz /  
93368L);
-    nScRandomIt = 33000L * (nScRandomIt %  65075L) -  8123L * (nScRandomIt /  
65075L);
-    if (nScRandomIx < 0)
-    nScRandomIx += 2147483579L;
-    if (nScRandomIy < 0)
-    nScRandomIy += 2147483543L;
-    if (nScRandomIz < 0)
-    nScRandomIz += 2147483123L;
-    if (nScRandomIt < 0)
-    nScRandomIt += 2147483123L;
-
-    fScRandomW = (double)nScRandomIx*0.0000000004656613022670 +
-            (double)nScRandomIy*0.0000000004656613100760 +
-        (double)nScRandomIz*0.0000000004656613360968 +
-        (double)nScRandomIt*0.0000000004656614011490;
+    // Seeding for the PRNG: should be pretty good.
+    if (SqSeeded == sal_False) {
+    rtl_random_getBytes(aPool, &nScRandomSeed, SCRANDOMQ_SIZE * 
sizeof(nScRandomSeed[0]));
+    SqSeeded = sal_True;
+    }
+
+    // Use George Marsaglia's 1998 KISS PRNG algorithm.
+    nScRandomSeed[0] = 69069 * nScRandomSeed[0] + 12345;
+    nScRandomSeed[1] ^= (nScRandomSeed[1] << 13);
+    nScRandomSeed[1] ^= (nScRandomSeed[1] >> 17);
+    nScRandomSeed[1] ^= (nScRandomSeed[1] << 5);
+    nScRandomt = nScRandoma * nScRandomSeed[2] + nScRandomSeed[3];
+    nScRandomSeed[1] = (nScRandomt >> 32);
 
+    fScRandomW = (nScRandomSeed[0] + nScRandomSeed[1] + (nScRandomSeed[3] = 
nScRandomt));
 
     // fMax -> range
     double fRet = fMax - fMin + 1.0;
-    fRet *= fScRandomW - (sal_Int32)fScRandomW ;
+    fRet *= fScRandomW / SAL_MAX_UINT32 ;
     fRet += fMin;
     fRet = floor( fRet );   // simple floor is sufficient here
     RETURN_FINITE( fRet );
commit 3c7fa88a1fb5f4ced5849c60ef47e71f5e740727
Author: Yuri Dario <yda...@apache.org>
Date:   Mon Sep 14 16:16:55 2015 +0000

    #i118923# OS/2, the emxexpr tool is no longer used.

diff --git a/solenv/inc/_tg_def.mk b/solenv/inc/_tg_def.mk
index bba5158..4a70d82 100644
--- a/solenv/inc/_tg_def.mk
+++ b/solenv/inc/_tg_def.mk
@@ -211,7 +211,7 @@ $(DEF1TARGETN) .PHONY :
 
 .IF "$(DEFLIB1NAME)"!=""
     @+echo $(SLB)/$(DEFLIB1NAME).lib
-    @+emxexpr $(DEF1NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF1NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB1NAME)"!=""
 
 .IF "$(DEF1EXPORT1)"!=""
@@ -495,7 +495,7 @@ $(DEF2TARGETN) .PHONY :
 
 .IF "$(DEFLIB2NAME)"!=""
     @+echo $(SLB)/$(DEFLIB2NAME).lib
-    @+emxexpr $(DEF2NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF2NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB2NAME)"!=""
 
 .IF "$(DEF2EXPORT1)"!=""
@@ -779,7 +779,7 @@ $(DEF3TARGETN) .PHONY :
 
 .IF "$(DEFLIB3NAME)"!=""
     @+echo $(SLB)/$(DEFLIB3NAME).lib
-    @+emxexpr $(DEF3NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF3NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB3NAME)"!=""
 
 .IF "$(DEF3EXPORT1)"!=""
@@ -1063,7 +1063,7 @@ $(DEF4TARGETN) .PHONY :
 
 .IF "$(DEFLIB4NAME)"!=""
     @+echo $(SLB)/$(DEFLIB4NAME).lib
-    @+emxexpr $(DEF4NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF4NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB4NAME)"!=""
 
 .IF "$(DEF4EXPORT1)"!=""
@@ -1347,7 +1347,7 @@ $(DEF5TARGETN) .PHONY :
 
 .IF "$(DEFLIB5NAME)"!=""
     @+echo $(SLB)/$(DEFLIB5NAME).lib
-    @+emxexpr $(DEF5NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF5NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB5NAME)"!=""
 
 .IF "$(DEF5EXPORT1)"!=""
@@ -1631,7 +1631,7 @@ $(DEF6TARGETN) .PHONY :
 
 .IF "$(DEFLIB6NAME)"!=""
     @+echo $(SLB)/$(DEFLIB6NAME).lib
-    @+emxexpr $(DEF6NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF6NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB6NAME)"!=""
 
 .IF "$(DEF6EXPORT1)"!=""
@@ -1915,7 +1915,7 @@ $(DEF7TARGETN) .PHONY :
 
 .IF "$(DEFLIB7NAME)"!=""
     @+echo $(SLB)/$(DEFLIB7NAME).lib
-    @+emxexpr $(DEF7NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF7NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB7NAME)"!=""
 
 .IF "$(DEF7EXPORT1)"!=""
@@ -2199,7 +2199,7 @@ $(DEF8TARGETN) .PHONY :
 
 .IF "$(DEFLIB8NAME)"!=""
     @+echo $(SLB)/$(DEFLIB8NAME).lib
-    @+emxexpr $(DEF8NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF8NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB8NAME)"!=""
 
 .IF "$(DEF8EXPORT1)"!=""
@@ -2483,7 +2483,7 @@ $(DEF9TARGETN) .PHONY :
 
 .IF "$(DEFLIB9NAME)"!=""
     @+echo $(SLB)/$(DEFLIB9NAME).lib
-    @+emxexpr $(DEF9NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF9NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB9NAME)"!=""
 
 .IF "$(DEF9EXPORT1)"!=""
@@ -2767,7 +2767,7 @@ $(DEF10TARGETN) .PHONY :
 
 .IF "$(DEFLIB10NAME)"!=""
     @+echo $(SLB)/$(DEFLIB10NAME).lib
-    @+emxexpr $(DEF10NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF10NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB10NAME)"!=""
 
 .IF "$(DEF10EXPORT1)"!=""
diff --git a/solenv/inc/tg_def.mk b/solenv/inc/tg_def.mk
index 2990bc2..ca8928d 100644
--- a/solenv/inc/tg_def.mk
+++ b/solenv/inc/tg_def.mk
@@ -216,7 +216,7 @@ $(DEF$(TNR)TARGETN) .PHONY :
 
 .IF "$(DEFLIB$(TNR)NAME)"!=""
     @+echo $(SLB)/$(DEFLIB$(TNR)NAME).lib
-    @+emxexpr $(DEF$(TNR)NAMELIST) | fix_exp_file >> $@.tmp_ord
+    @+emxexp $(DEF$(TNR)NAMELIST) | fix_exp_file >> $@.tmp_ord
 .ENDIF                         # "$(DEFLIB$(TNR)NAME)"!=""
 
 .IF "$(DEF$(TNR)EXPORT1)"!=""
commit b7a4e86213234adcaf977851d948060f4744064f
Author: Yuri Dario <yda...@apache.org>
Date:   Mon Sep 14 16:10:03 2015 +0000

    #i118923# OS/2, use pmbidi header from dev toolkit.

diff --git a/solenv/inc/svpm.h b/solenv/inc/svpm.h
index 6affa2e..63deb02 100644
--- a/solenv/inc/svpm.h
+++ b/solenv/inc/svpm.h
@@ -61,6 +61,9 @@ extern "C" {
 
 #include <os2.h>
 #include <unikbd.h>
+#ifdef VCL_OS2
+#include <pmbidi.h>
+#endif
 
 #undef BOOL
 #undef BYTE
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 59a3195..70eb695 100755
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -45,6 +45,12 @@ $(eval $(call gb_Library_set_include,vcl,\
     -I$(OUTDIR)/inc \
     $$(FREETYPE_CFLAGS) \
 ))
+ifeq ($(GUIBASE),os2)
+$(eval $(call gb_Library_set_include,vcl,\
+    $$(INCLUDE) \
+    -idirafter /@unixroot/usr/dev/toolkit452/h \
+))
+endif
 ifeq ($(GUIBASE),unx)
 $(eval $(call gb_Library_set_cxxflags,vcl,\
     $$(CXXFLAGS) \
diff --git a/vcl/inc/os2/salframe.h b/vcl/inc/os2/salframe.h
index 40467f6..eea4064 100644
--- a/vcl/inc/os2/salframe.h
+++ b/vcl/inc/os2/salframe.h
@@ -27,10 +27,6 @@
 #include <vcl/sysdata.hxx>
 #include <salframe.hxx>
 
-#ifndef PM_BIDI_INCLUDED
-#include <pmbidi.h>
-#endif
-
 #ifndef __UCONV_H__
 #include <uconv.h>
 #endif
diff --git a/vcl/os2/source/window/salframe.cxx 
b/vcl/os2/source/window/salframe.cxx
index 2b4eacd..0e7887f 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -24,6 +24,7 @@
 #define INCL_DOS
 #define INCL_PM
 #define INCL_WIN
+#define VCL_OS2
 #include <svpm.h>
 
 #include <string.h>
commit ee129190a4d4025308062a17ba6c682969214a5b
Author: Yuri Dario <yda...@apache.org>
Date:   Mon Sep 14 10:26:32 2015 +0000

    #i118923# OS/2, use the legacy config.site script.

diff --git a/set_soenv.in b/set_soenv.in
index 17d3022..33036c9 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2039,7 +2039,7 @@ if ( $platform =~ m/os2/ )
    ToFile( "LS",                "ls.exe",           "e" );
    ToFile( "GNUCOPY",           "cp.exe",           "e" );
    ToFile( "TOUCH",             "touch",            "e" );
-   ToFile( "CONFIG_SITE",       "/@unixroot/usr/share/config.site", "e" );
+   ToFile( "CONFIG_SITE",       "/@unixroot/usr/share/config.legacy", "e" );
 }
 
 # $perlpre is only used for the following three variables
commit b423f3b301750cba48eea834c296d51a3bd9cfdd
Author: Yuri Dario <yda...@apache.org>
Date:   Mon Sep 14 10:05:40 2015 +0000

    #i125592# use a short name for xmlsecurity library.

diff --git a/xmlsecurity/util/makefile.mk b/xmlsecurity/util/makefile.mk
index f4b8f45..d1d7408 100644
--- a/xmlsecurity/util/makefile.mk
+++ b/xmlsecurity/util/makefile.mk
@@ -141,6 +141,9 @@ RESLIB1IMAGES=$(PRJ)$/res
 RESLIB1SRSFILES= $(SRSFILELIST)
 
 SHL4TARGET=$(TARGET)
+.IF "$(GUI)"=="OS2"
+SHL4TARGET=xmlsecur
+.ENDIF
 SHL4LIBS=\
                 $(SLB)$/helper.lib      \
                 $(SLB)$/dialogs.lib     \
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to