ReactOS  0.4.14-dev-342-gdc047f9
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 56 of file rot.c.

57 {
58  int max_bits = sizeof(unsigned long)<<3;
59  if ( shift < 0 )
60  return _lrotr(value,-shift);
61 
62  if ( shift > max_bits )
63  shift = shift % max_bits;
64  return (value << shift) | (value >> (max_bits-shift));
65 }
#define shift
Definition: input.c:1668
unsigned long _lrotr(unsigned long value, int shift)
Definition: rot.c:70
#define long
Definition: qsort.c:33

Referenced by _lrotr().

◆ _lrotr()

unsigned long _lrotr ( unsigned long  value,
int  shift 
)

Definition at line 70 of file rot.c.

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

Referenced by _lrotl().

◆ _rotl()

unsigned int _rotl ( unsigned int  value,
int  shift 
)

Definition at line 28 of file rot.c.

29 {
30  int max_bits = sizeof(unsigned int)<<3;
31  if ( shift < 0 )
32  return _rotr(value,-shift);
33 
34  if ( shift > max_bits )
35  shift = shift % max_bits;
36  return (value << shift) | (value >> (max_bits-shift));
37 }
#define shift
Definition: input.c:1668
unsigned int _rotr(unsigned int value, int shift)
Definition: rot.c:42
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 42 of file rot.c.

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

Referenced by _rotl().