diff options
Diffstat (limited to 'cube.c')
| -rw-r--r-- | cube.c | 40 |
1 files changed, 20 insertions, 20 deletions
| @@ -31,13 +31,13 @@ | |||
| 31 | 31 | ||
| 32 | _static_inline cube_t invertco(cube_t); | 32 | _static_inline cube_t invertco(cube_t); |
| 33 | _static int permsign(uint8_t *, int); | 33 | _static int permsign(uint8_t *, int); |
| 34 | _static uint8_t readco(char *); | 34 | _static uint8_t readco(const char *); |
| 35 | _static uint8_t readcp(char *); | 35 | _static uint8_t readcp(const char *); |
| 36 | _static uint8_t readeo(char *); | 36 | _static uint8_t readeo(const char *); |
| 37 | _static uint8_t readep(char *); | 37 | _static uint8_t readep(const char *); |
| 38 | _static cube_t read_H48(char *); | 38 | _static cube_t read_H48(const char *); |
| 39 | _static uint8_t readpiece_LST(char **); | 39 | _static uint8_t readpiece_LST(const char **); |
| 40 | _static cube_t read_LST(char *); | 40 | _static cube_t read_LST(const char *); |
| 41 | _static int writepiece_LST(uint8_t, char *); | 41 | _static int writepiece_LST(uint8_t, char *); |
| 42 | _static void write_H48(cube_t, char *); | 42 | _static void write_H48(cube_t, char *); |
| 43 | _static void write_LST(cube_t, char *); | 43 | _static void write_LST(cube_t, char *); |
| @@ -45,7 +45,7 @@ _static uint8_t readmove(char); | |||
| 45 | _static uint8_t readmodifier(char); | 45 | _static uint8_t readmodifier(char); |
| 46 | 46 | ||
| 47 | _static uint8_t | 47 | _static uint8_t |
| 48 | readco(char *str) | 48 | readco(const char *str) |
| 49 | { | 49 | { |
| 50 | if (*str == '0') | 50 | if (*str == '0') |
| 51 | return 0; | 51 | return 0; |
| @@ -59,7 +59,7 @@ readco(char *str) | |||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | _static uint8_t | 61 | _static uint8_t |
| 62 | readcp(char *str) | 62 | readcp(const char *str) |
| 63 | { | 63 | { |
| 64 | uint8_t c; | 64 | uint8_t c; |
| 65 | 65 | ||
| @@ -73,7 +73,7 @@ readcp(char *str) | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | _static uint8_t | 75 | _static uint8_t |
| 76 | readeo(char *str) | 76 | readeo(const char *str) |
| 77 | { | 77 | { |
| 78 | if (*str == '0') | 78 | if (*str == '0') |
| 79 | return 0; | 79 | return 0; |
| @@ -85,7 +85,7 @@ readeo(char *str) | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | _static uint8_t | 87 | _static uint8_t |
| 88 | readep(char *str) | 88 | readep(const char *str) |
| 89 | { | 89 | { |
| 90 | uint8_t e; | 90 | uint8_t e; |
| 91 | 91 | ||
| @@ -98,12 +98,12 @@ readep(char *str) | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | _static cube_t | 100 | _static cube_t |
| 101 | read_H48(char *buf) | 101 | read_H48(const char *buf) |
| 102 | { | 102 | { |
| 103 | int i; | 103 | int i; |
| 104 | uint8_t piece, orient; | 104 | uint8_t piece, orient; |
| 105 | cube_t ret = {0}; | 105 | cube_t ret = {0}; |
| 106 | char *b; | 106 | const char *b; |
| 107 | 107 | ||
| 108 | b = buf; | 108 | b = buf; |
| 109 | 109 | ||
| @@ -134,7 +134,7 @@ read_H48(char *buf) | |||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | _static uint8_t | 136 | _static uint8_t |
| 137 | readpiece_LST(char **b) | 137 | readpiece_LST(const char **b) |
| 138 | { | 138 | { |
| 139 | uint8_t ret; | 139 | uint8_t ret; |
| 140 | bool read; | 140 | bool read; |
| @@ -151,7 +151,7 @@ readpiece_LST(char **b) | |||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | _static cube_t | 153 | _static cube_t |
| 154 | read_LST(char *buf) | 154 | read_LST(const char *buf) |
| 155 | { | 155 | { |
| 156 | int i; | 156 | int i; |
| 157 | cube_t ret = {0}; | 157 | cube_t ret = {0}; |
| @@ -547,7 +547,7 @@ cube_coord_eo(cube_t c) | |||
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | cube_t | 549 | cube_t |
| 550 | cube_read(char *format, char *buf) | 550 | cube_read(const char *format, const char *buf) |
| 551 | { | 551 | { |
| 552 | cube_t cube; | 552 | cube_t cube; |
| 553 | 553 | ||
| @@ -564,7 +564,7 @@ cube_read(char *format, char *buf) | |||
| 564 | } | 564 | } |
| 565 | 565 | ||
| 566 | void | 566 | void |
| 567 | cube_write(char *format, cube_t cube, char *buf) | 567 | cube_write(const char *format, cube_t cube, char *buf) |
| 568 | { | 568 | { |
| 569 | char *errormsg; | 569 | char *errormsg; |
| 570 | size_t len; | 570 | size_t len; |
| @@ -594,11 +594,11 @@ write_error: | |||
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | int | 596 | int |
| 597 | cube_readmoves(char *buf, move_t *ret) | 597 | cube_readmoves(const char *buf, move_t *ret) |
| 598 | { | 598 | { |
| 599 | int n; | 599 | int n; |
| 600 | move_t r, m; | 600 | move_t r, m; |
| 601 | char *b; | 601 | const char *b; |
| 602 | 602 | ||
| 603 | for (n = 0, b = buf; *b != '\0'; b++) { | 603 | for (n = 0, b = buf; *b != '\0'; b++) { |
| 604 | while (*b == ' ' || *b == '\t' || *b == '\n') | 604 | while (*b == ' ' || *b == '\t' || *b == '\n') |
| @@ -621,7 +621,7 @@ applymoves_error: | |||
| 621 | } | 621 | } |
| 622 | 622 | ||
| 623 | trans_t | 623 | trans_t |
| 624 | cube_readtrans(char *buf) | 624 | cube_readtrans(const char *buf) |
| 625 | { | 625 | { |
| 626 | trans_t t; | 626 | trans_t t; |
| 627 | 627 | ||
