Skip to content

Commit

Permalink
Change lab01 rotations parameter type
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Popa <[email protected]>
  • Loading branch information
c7stef authored and teodutu committed Mar 5, 2024
1 parent e6a2a36 commit 9216b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions laborator/content/reprezentare-numere/4-rotations/rotations.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <stdio.h>

void rotate_left(int *number, int bits)
void rotate_left(unsigned int *number, int bits)
{
/* TODO */
(void) number;
(void) bits;
}

void rotate_right(int *number, int bits)
void rotate_right(unsigned int *number, int bits)
{
/* TODO */
(void) number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <stdio.h>

void rotate_left(int *number, int bits)
void rotate_left(unsigned int *number, int bits)
{
unsigned int bit_mask = -1;

Expand All @@ -13,7 +13,7 @@ void rotate_left(int *number, int bits)
(*number) |= bit_mask;
}

void rotate_right(int *number, int bits)
void rotate_right(unsigned int *number, int bits)
{
unsigned int bit_mask = -1;

Expand All @@ -26,7 +26,7 @@ void rotate_right(int *number, int bits)

int main(void)
{
int number;
unsigned int number;

number = 0x80000000;
rotate_left(&number, 1);
Expand Down

0 comments on commit 9216b71

Please sign in to comment.