diff --git a/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/solution/rotations.c b/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/solution/rotations.c index 1eaa3140..5f5f30d7 100644 --- a/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/solution/rotations.c +++ b/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/solution/rotations.c @@ -2,7 +2,7 @@ #include -void rotate_left(int *number, int bits) +void rotate_left(unsigned int *number, int bits) { unsigned int bit_mask = -1; @@ -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; @@ -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); diff --git a/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/support/rotations.c b/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/support/rotations.c index 134ea8ec..929c3db4 100644 --- a/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/support/rotations.c +++ b/chapters/intro-computer-architecture/binary-hex/drills/tasks/rotations/support/rotations.c @@ -2,14 +2,14 @@ #include -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;