1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-30 05:40:06 +00:00
freebsd-ports/sysutils/sformat/files/patch-sformat::bcrypt.c
Marius Strobl 12657ca8d2 - Use the libschily sources taken from cdrtools 2.01.01a07 instead of those
shipping with sformat 3.5 for building sformat; the former include their
  own version of __dtoa() which is no longer externally visible with libc
  symbol versioning turned on (thus breaking the build of stock sformat).
- While here also use MASTER_SITE_LOCAL for providing a backup mirror of
  the sformat 3.5 distfile instead of using a private one.
- Fix the checksumming of sformat.dat on LP64 platforms so sformat doesn't
  erroneously complain about that file containing uncertified data there.
  Bump PORTREVISION for this.

Approved by:	netchild
2006-04-15 11:35:45 +00:00

85 lines
1.3 KiB
C

--- sformat/bcrypt.c.orig Fri Oct 9 21:13:57 1998
+++ sformat/bcrypt.c Thu Apr 13 19:09:55 2006
@@ -27,10 +27,9 @@
#include <unixstd.h>
#include <stdxlib.h>
#include <strdefs.h>
+#include <utypes.h>
#include "fmt.h"
-typedef unsigned long Ulong;
-
EXPORT char *getnenv __PR((const char *, int));
EXPORT Ulong my_gethostid __PR((void));
EXPORT BOOL bsecurity __PR((int));
@@ -104,17 +103,17 @@
Ulong bcrypt(i)
Ulong i;
{
- register Ulong k;
- register Ulong erg;
+ register Uint k;
+ register Uint erg;
- k = i + 19991;
+ k = ((Uint)i) + 19991;
erg = 0;
do {
erg += 1 + k / 19;
erg *= 1 + k % 19;
k /= 11;
} while (k != 0);
- return (erg);
+ return ((Ulong)erg);
}
@@ -128,22 +127,24 @@
char *bmap(i)
register Ulong i;
{
+ register Uint l;
register int c;
static char buf[8];
register char *bp;
+ l = (Uint)i;
bp = &buf[7];
*bp = '\0';
do {
- c = i % 64;
- i /= 64;
+ c = l % 64;
+ l /= 64;
c += '.';
if(c > '9')
c += 7;
if(c > 'Z')
c += 6;
*--bp = c;
- } while (i);
+ } while (l);
return (bp);
}
@@ -158,10 +159,10 @@
Ulong bunmap(s)
register const char *s;
{
- register Ulong l;
+ register Uint l;
register int c;
- l = 0L;
+ l = 0;
while (*s) {
c = *s++;
if(c > 'Z')
@@ -172,5 +173,5 @@
l *= 64;
l += c;
}
- return (l);
+ return ((Ulong)l);
}