From 3663ca6c2d4c42c4a7bf6af4b2edf71dd8d10dd7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 12 May 2015 13:10:23 -0700 Subject: 1356 - snapshot #2: floating point support I added one test to check that divide can return a float, then hacked at the rippling failures across the entire entire codebase until all tests pass. Now I need to look at the changes I made and see if there's a system to them, identify other places that I missed, and figure out the best way to cover all cases. I also need to show real rather than encoded values in the traces, but I can't use value() inside reagent methods because of the name clash with the member variable. So let's take a snapshot before we attempt any refactoring. This was non-trivial to get right. Even if I convince myself that I've gotten it right, I might back this all out if I can't easily *persuade others* that I've gotten it right. --- 070display.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '070display.cc') diff --git a/070display.cc b/070display.cc index 8a782f87..7c850ef8 100644 --- a/070display.cc +++ b/070display.cc @@ -70,7 +70,7 @@ case PRINT_CHARACTER_TO_DISPLAY: { size_t height = (h >= 0) ? h : 0; size_t width = (w >= 0) ? w : 0; assert(ingredients.at(0).size() == 1); // scalar - long long int c = ingredients.at(0).at(0); + long long int c = value(ingredients.at(0).at(0)); // unicode code-point will probably always be a positive integer if (c == '\n' || c == '\r') { if (Display_row < height-1) { Display_column = 0; @@ -117,9 +117,9 @@ Recipe_number["move-cursor-on-display"] = MOVE_CURSOR_ON_DISPLAY; :(before "End Primitive Recipe Implementations") case MOVE_CURSOR_ON_DISPLAY: { assert(ingredients.at(0).size() == 1); // scalar - Display_row = ingredients.at(0).at(0); + Display_row = ingredients.at(0).at(0); // screen coordinate will always be a non-negative integer assert(ingredients.at(1).size() == 1); // scalar - Display_column = ingredients.at(1).at(0); + Display_column = ingredients.at(1).at(0); // screen coordinate will always be a non-negative integer tb_set_cursor(Display_column, Display_row); tb_present(); break; -- cgit 1.4.1-2-gfad0 grep'>log msg
path: root/chessboard-cursor.mu
blob: af7dd273753f3d78c661cb19bbf7e80d81d4c032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257