Skip to content

Commit

Permalink
updated docs comments and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
deftio committed Apr 15, 2024
1 parent 45f1152 commit 4623bda
Show file tree
Hide file tree
Showing 7 changed files with 1,049 additions and 958 deletions.
761 changes: 384 additions & 377 deletions FR_Math_Example1.cpp

Large diffs are not rendered by default.

58 changes: 27 additions & 31 deletions FR_defs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file FR_Defs.h - type definitions used in Fixed-Radix math lib
*
*
* @copy Copyright (C) <2001-2012> <M. A. Chatterjee>
* @author M A Chatterjee <deftio [at] deftio [dot] com>
* @version 1.01 M. A. Chatterjee, cleaned up naming
Expand Down Expand Up @@ -29,48 +29,44 @@
#ifndef __FR_Platform_Defs_H__
#define __FR_Platform_Defs_H__

typedef unsigned char u8 ;
typedef signed char s8 ;
typedef unsigned short u16 ;
typedef signed short s16 ;
typedef unsigned long u32 ;
typedef signed long s32 ;


typedef short FR_bool;
typedef u16 FR_RESULT;
typedef unsigned char u8;
typedef signed char s8;
typedef unsigned short u16;
typedef signed short s16;
typedef unsigned long u32;
typedef signed long s32;

#define FR_SWAP_BYTES(x) (((x>>8)&0xff)|((x<<8)&0xff00))
typedef short FR_bool;
typedef u16 FR_RESULT;

#define FR_SWAP_BYTES(x) (((x >> 8) & 0xff) | ((x << 8) & 0xff00))

// Return codes

#ifdef WIN32
#pragma warning( disable : 4001 4514)
#pragma warning(disable : 4001 4514)
#endif

//generic error codes
#define FR_S_OK (0x0000)
// generic error codes
#define FR_S_OK (0x0000)

#define FR_E_FAIL (0x8000)
#define FR_E_BADARGUMENTS (0x8001)
#define FR_E_NULLPOINTER (0x8002)
#define FR_E_INDEXOUTOFRANGE (0x8003)
#define FR_E_BUFFERFULL (0x8004)
#define FR_E_NOTIMPLEMENTED (0x8005)
#define FR_E_MEMALLOCFAILED (0x8006)
#define FR_E_UNKNOWNOBJECT (0x8007)
#define FR_E_FAIL (0x8000)
#define FR_E_BADARGUMENTS (0x8001)
#define FR_E_NULLPOINTER (0x8002)
#define FR_E_INDEXOUTOFRANGE (0x8003)
#define FR_E_BUFFERFULL (0x8004)
#define FR_E_NOTIMPLEMENTED (0x8005)
#define FR_E_MEMALLOCFAILED (0x8006)
#define FR_E_UNKNOWNOBJECT (0x8007)

//math specific
#define FR_E_UNABLE (0x8100)
// math specific
#define FR_E_UNABLE (0x8100)

#define FR_FAILED(x) (x&0x8000)
#define FR_SUCCEEDED(x) (!(x&0x8000))
#define FR_FAILED(x) (x & 0x8000)
#define FR_SUCCEEDED(x) (!(x & 0x8000))

/*******************************/
#define FR_FALSE (0)
#define FR_TRUE (!FR_FALSE)

#define FR_FALSE (0)
#define FR_TRUE (!FR_FALSE)

#endif // __FR_Platform_Defs_H__

Loading

0 comments on commit 4623bda

Please sign in to comment.