security/nss/lib/freebl/mpi/make-logtab

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rwxr-xr-x

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 #!/usr/bin/perl
     3 #
     4 # make-logtab
     5 #
     6 # Generate a table of logarithms of 2 in various bases, for use in
     7 # estimating the output sizes of various bases.
     9 # This Source Code Form is subject to the terms of the Mozilla Public
    10 # License, v. 2.0. If a copy of the MPL was not distributed with this
    11 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
    13 $ARRAYNAME = $ENV{'ARRAYNAME'} || "s_logv_2";
    14 $ARRAYTYPE = $ENV{'ARRAYTYPE'} || "float";
    16 printf("const %s %s[] = {\n   %0.9ff, %0.9ff, ", 
    17        $ARRAYTYPE, $ARRAYNAME, 0, 0);
    18 $brk = 2;
    19 for($ix = 2; $ix < 64; $ix++) {
    20     printf("%0.9ff, ", (log(2)/log($ix)));
    21     $brk = ($brk + 1) & 3;
    22     if(!$brk) {
    23 	printf(" /* %2d %2d %2d %2d */\n   ",
    24 	       $ix - 3, $ix - 2, $ix - 1, $ix);
    25     }
    26 }
    27 printf("%0.9ff\n};\n\n", (log(2)/log($ix)));
    29 exit 0;

mercurial