mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
- Cleaned up the OS4 build, dropping unused code and introducing the
dreaded Flush() macro. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/amiga-smbfs/trunk@9 26594b9e-b914-4e86-b7a1-9402bd427170
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.os4,v 1.2 2005-05-27 09:48:26 obarthel Exp $
|
||||
# $Id: GNUmakefile.os4,v 1.3 2005-05-29 08:32:58 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@@ -36,16 +36,12 @@ CC = ppc-amigaos-gcc
|
||||
|
||||
###########################################################################
|
||||
|
||||
#WARNINGS = \
|
||||
# -Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
|
||||
# -Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
|
||||
|
||||
WARNINGS = \
|
||||
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
|
||||
-Wundef -Wbad-function-cast -Wmissing-declarations
|
||||
|
||||
CPU = -mcpu=604e -msoft-float
|
||||
OPTIONS = -DNDEBUG -fno-builtin
|
||||
OPTIONS = -DNDEBUG
|
||||
OPTIMIZE = -O3
|
||||
DEBUG = -ggdb
|
||||
|
||||
|
||||
+7
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: main.c,v 1.2 2005-05-27 09:48:26 obarthel Exp $
|
||||
* $Id: main.c,v 1.3 2005-05-29 08:32:58 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -34,6 +34,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__amigaos4__) && !defined(Flush)
|
||||
#define Flush(fh) FFlush(fh)
|
||||
#endif /* __amigaos4__ && !Flush */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "smbfs_rev.h"
|
||||
STRPTR Version = VERSTAG;
|
||||
|
||||
|
||||
+1
-57
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: quad_math.c,v 1.1 2005-05-27 09:48:26 obarthel Exp $
|
||||
* $Id: quad_math.c,v 1.2 2005-05-29 08:32:58 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -28,62 +28,6 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Multiply two unsigned 32 bit quantities, yielding a 64 bit product. */
|
||||
void
|
||||
multiply_32_by_32_to_64(ULONG ab,ULONG cd,QUAD * abcd)
|
||||
{
|
||||
ULONG a,b,c,d,ad_plus_bc_low,ad_plus_bc_high,bc,bd,ad;
|
||||
|
||||
/* Split the factors again so that the following is true:
|
||||
*
|
||||
* ab = (a * 65536) + b
|
||||
* cd = (c * 65536) + d
|
||||
*/
|
||||
a = (ab >> 16);
|
||||
b = ab & 0xFFFF;
|
||||
c = (cd >> 16);
|
||||
d = cd & 0xFFFF;
|
||||
|
||||
/* We need to calculate the following product:
|
||||
*
|
||||
* ab * cd = (a * 65536 + b) * cd
|
||||
* = a * 65536 * cd + b * cd
|
||||
* = a * 65536 * (c * 65536 + d) + b * (c * 65536 + d)
|
||||
* = a * 65536 * c * 65536 + a * 65536 * d + b + c * 65536 + b * d
|
||||
* = ac * 65536 * 65536 + ad * 65536 + bc * 65536 * bd
|
||||
* = ac * 65536 * 65536 + (ad + bc) * 65536 + bc
|
||||
*/
|
||||
ad = a * d;
|
||||
bc = b * c;
|
||||
bd = b * d;
|
||||
|
||||
/* We can put the most and least significant components of the
|
||||
* product right into the result buffer.
|
||||
*/
|
||||
abcd->High = a * c;
|
||||
abcd->Low = bd;
|
||||
|
||||
/* Add ad and bc and check if there was an overflow. */
|
||||
ad_plus_bc_low = ad + bc;
|
||||
ad_plus_bc_high = (ad_plus_bc_low < ad) ? 1 : 0;
|
||||
|
||||
/* Add the lower 16 bits of the ad+bc sum to the least
|
||||
* significant component of the result buffer and
|
||||
* check for overflow.
|
||||
*/
|
||||
abcd->Low += (ad_plus_bc_low << 16);
|
||||
if(abcd->Low < bd)
|
||||
abcd->High++;
|
||||
|
||||
/* Add the upper 16 bits of the ad+bc sum to the most
|
||||
* significant component of the result buffer. Add
|
||||
* the overflow bit of the ad+bc sum, too.
|
||||
*/
|
||||
abcd->High += ((ad_plus_bc_low >> 16) & 0xFFFF) + (ad_plus_bc_high << 16);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Divide a 64 bit integer by a 32 bit integer, filling in a 64 bit quotient
|
||||
and returning a 32 bit remainder. */
|
||||
ULONG
|
||||
|
||||
Reference in New Issue
Block a user