aboutsummaryrefslogtreecommitdiff
path: root/cube.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-04-15 16:07:52 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-04-15 16:07:52 +0200
commitba4e25810e0b845fe0488bc504bf3ab5bd1f3824 (patch)
tree66b9e350084139e330f0ce90cb5f6749c48d5396 /cube.c
parent59ecc0ee72a180692fcccab88db310d60021f2ab (diff)
downloadcubecore-ba4e25810e0b845fe0488bc504bf3ab5bd1f3824.tar.gz
cubecore-ba4e25810e0b845fe0488bc504bf3ab5bd1f3824.zip
const char *
Diffstat (limited to 'cube.c')
-rw-r--r--cube.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/cube.c b/cube.c
index f44a7df..5ba3430 100644
--- a/cube.c
+++ b/cube.c
@@ -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
48readco(char *str) 48readco(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
62readcp(char *str) 62readcp(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
76readeo(char *str) 76readeo(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
88readep(char *str) 88readep(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
101read_H48(char *buf) 101read_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
137readpiece_LST(char **b) 137readpiece_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
154read_LST(char *buf) 154read_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
549cube_t 549cube_t
550cube_read(char *format, char *buf) 550cube_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
566void 566void
567cube_write(char *format, cube_t cube, char *buf) 567cube_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
596int 596int
597cube_readmoves(char *buf, move_t *ret) 597cube_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
623trans_t 623trans_t
624cube_readtrans(char *buf) 624cube_readtrans(const char *buf)
625{ 625{
626 trans_t t; 626 trans_t t;
627 627

Generated with cgit - Back to sebastiano.tronto.net