Skip to content

Commit 58c9f63

Browse files
authored
Merge pull request #72 from denniskovshov/patch-1
added missing casting for malloc
2 parents 051b5c0 + 622f1c8 commit 58c9f63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_parts/part3.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ memory release function and handle a few more error cases:
183183

184184
```diff
185185
+ Table* new_table() {
186-
+ Table* table = malloc(sizeof(Table));
186+
+ Table* table = (Table*)malloc(sizeof(Table));
187187
+ table->num_rows = 0;
188188
+ for (uint32_t i = 0; i < TABLE_MAX_PAGES; i++) {
189189
+ table->pages[i] = NULL;
@@ -342,7 +342,7 @@ We'll address those issues in the next part. For now, here's the complete diff f
342342
+}
343343
+
344344
+Table* new_table() {
345-
+ Table* table = malloc(sizeof(Table));
345+
+ Table* table = (Table*)malloc(sizeof(Table));
346346
+ table->num_rows = 0;
347347
+ for (uint32_t i = 0; i < TABLE_MAX_PAGES; i++) {
348348
+ table->pages[i] = NULL;
@@ -358,7 +358,7 @@ We'll address those issues in the next part. For now, here's the complete diff f
358358
+}
359359
+
360360
InputBuffer* new_input_buffer() {
361-
InputBuffer* input_buffer = malloc(sizeof(InputBuffer));
361+
InputBuffer* input_buffer = (InputBuffer*)malloc(sizeof(InputBuffer));
362362
input_buffer->buffer = NULL;
363363
@@ -40,17 +140,105 @@ void close_input_buffer(InputBuffer* input_buffer) {
364364
free(input_buffer);

0 commit comments

Comments
 (0)