Skip to content

Commit

Permalink
comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Strophox committed Aug 30, 2024
1 parent d14235c commit 730bd97
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tools/miri/tests/native-lib/ptr_read_access.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <stdio.h>

/* Test: `test_pointer` */
/* Test: test_pointer */

void print_pointer(const int *ptr) {
printf("printing pointer dereference from C: %d\n", *ptr);
}

/* Test: `test_simple` */
/* Test: test_simple */

typedef struct Simple {
int field;
Expand All @@ -16,16 +16,16 @@ int access_simple(const Simple *s_ptr) {
return s_ptr->field;
}

/* Test: `test_nested` */
/* Test: test_nested */

typedef struct Nested {
int value;
struct Nested *next;
} Nested;

// Returns the innermost/last `value` of a `Nested` pointer chain.
// Returns the innermost/last value of a Nested pointer chain.
int access_nested(const Nested *n_ptr) {
// Edge case: `n_ptr == NULL`, first `Nested` is None).
// Edge case: `n_ptr == NULL` (i.e. first Nested is None).
if (!n_ptr) { return 0; }

while (n_ptr->next) {
Expand All @@ -35,7 +35,7 @@ int access_nested(const Nested *n_ptr) {
return n_ptr->value;
}

/* Test: `test_static */
/* Test: test_static */

typedef struct Static {
int value;
Expand Down

0 comments on commit 730bd97

Please sign in to comment.