ReactOS  0.4.15-dev-1619-g69dffed
rot.c File Reference
#include <stdlib.h>
Include dependency graph for rot.c:

Go to the source code of this file.

Macros

#define ASM_ALIAS(x)
 

Functions

unsigned int _rotr (unsigned int value, int shift) ASM_ALIAS("__rotr")
 
unsigned long _lrotr (unsigned long value, int shift) ASM_ALIAS("__lrotr")
 
unsigned int _rotl (unsigned int value, int shift) ASM_ALIAS("__rotl")
 
unsigned long _lrotl (unsigned long value, int shift) ASM_ALIAS("__lrotl")
 

Macro Definition Documentation

◆ ASM_ALIAS

#define ASM_ALIAS (   x)

Definition at line 25 of file rot.c.

Function Documentation

◆ _lrotl()

unsigned long _lrotl ( unsigned long  value,
int  shift 
)

Definition at line 64 of file rot.c.

65 {
66  int max_bits = sizeof(unsigned long)<<3;
67  if ( shift < 0 )
68  return _lrotr(value,-shift);
69 
70  if ( shift > max_bits )
71  shift = shift % max_bits;
72  return (value << shift) | (value >> (max_bits-shift));
73 }
#define shift
Definition: input.c:1756
unsigned long _lrotr(unsigned long value, int shift) ASM_ALIAS("__lrotr")
Definition: rot.c:78
#define long
Definition: qsort.c:33

Referenced by _lrotr().

◆ _lrotr()

unsigned long _lrotr ( unsigned long  value,
int  shift 
)

Definition at line 78 of file rot.c.

79 {
80  int max_bits = sizeof(unsigned long)<<3;
81  if ( shift < 0 )
82  return _lrotl(value,-shift);
83 
84  if ( shift > max_bits )
85  shift = shift % max_bits;
86  return (value >> shift) | (value << (max_bits-shift));
87 }
#define shift
Definition: input.c:1756
unsigned long _lrotl(unsigned long value, int shift) ASM_ALIAS("__lrotl")
Definition: rot.c:64
#define long
Definition: qsort.c:33

Referenced by _lrotl().

◆ _rotl()

unsigned int _rotl ( unsigned int  value,
int  shift 
)

Definition at line 36 of file rot.c.

37 {
38  int max_bits = sizeof(unsigned int)<<3;
39  if ( shift < 0 )
40  return _rotr(value,-shift);
41 
42  if ( shift > max_bits )
43  shift = shift % max_bits;
44  return (value << shift) | (value >> (max_bits-shift));
45 }
#define shift
Definition: input.c:1756
unsigned int _rotr(unsigned int value, int shift) ASM_ALIAS("__rotr")
Definition: rot.c:50
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by _rotr().

◆ _rotr()

unsigned int _rotr ( unsigned int  value,
int  shift 
)

Definition at line 50 of file rot.c.

51 {
52  int max_bits = sizeof(unsigned int)<<3;
53  if ( shift < 0 )
54  return _rotl(value,-shift);
55 
56  if ( shift > max_bits )
57  shift = shift % max_bits;
58  return (value >> shift) | (value << (max_bits-shift));
59 }
#define shift
Definition: input.c:1756
unsigned int _rotl(unsigned int value, int shift) ASM_ALIAS("__rotl")
Definition: rot.c:36
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by _rotl().