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

Go to the source code of this file.

Functions

unsigned int _rotr (unsigned int value, int shift)
 
unsigned long _lrotr (unsigned long value, int shift)
 
unsigned int _rotl (unsigned int value, int shift)
 
unsigned long _lrotl (unsigned long value, int shift)
 

Function Documentation

◆ _lrotl()

unsigned long _lrotl ( unsigned long  value,
int  shift 
)

Definition at line 71 of file rot.c.

72{
73 int max_bits = sizeof(unsigned long)<<3;
74 if ( shift < 0 )
75 return _lrotr(value,-shift);
76
77 if ( shift > max_bits )
78 shift = shift % max_bits;
79 return (value << shift) | (value >> (max_bits-shift));
80}
#define shift
Definition: input.c:1755
#define long
Definition: qsort.c:33
unsigned long _lrotr(unsigned long value, int shift)
Definition: rot.c:85
Definition: pdh_main.c:94

Referenced by _lrotr().

◆ _lrotr()

unsigned long _lrotr ( unsigned long  value,
int  shift 
)

Definition at line 85 of file rot.c.

86{
87 int max_bits = sizeof(unsigned long)<<3;
88 if ( shift < 0 )
89 return _lrotl(value,-shift);
90
91 if ( shift > max_bits )
92 shift = shift % max_bits;
93 return (value >> shift) | (value << (max_bits-shift));
94}
unsigned long _lrotl(unsigned long value, int shift)
Definition: rot.c:71

Referenced by _lrotl().

◆ _rotl()

unsigned int _rotl ( unsigned int  value,
int  shift 
)

Definition at line 43 of file rot.c.

44{
45 int max_bits = sizeof(unsigned int)<<3;
46 if ( shift < 0 )
47 return _rotr(value,-shift);
48
49 if ( shift > max_bits )
50 shift = shift % max_bits;
51 return (value << shift) | (value >> (max_bits-shift));
52}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned int _rotr(unsigned int value, int shift)
Definition: rot.c:57

Referenced by _rotr().

◆ _rotr()

unsigned int _rotr ( unsigned int  value,
int  shift 
)

Definition at line 57 of file rot.c.

58{
59 int max_bits = sizeof(unsigned int)<<3;
60 if ( shift < 0 )
61 return _rotl(value,-shift);
62
63 if ( shift > max_bits )
64 shift = shift % max_bits;
65 return (value >> shift) | (value << (max_bits-shift));
66}
unsigned int _rotl(unsigned int value, int shift)
Definition: rot.c:43

Referenced by _rotl().