diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 09:15:25 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 09:15:25 -0800 |
| commit | 3ededef53d0704f8b89c55f60bef52a64b86d62c (patch) | |
| tree | 686fc67dcc174e4ae729408577c93a25fab2592b /files.c | |
| parent | 65141b240218df4c40196db63429b90b1cb698a9 (diff) | |
Static analysis part 1
Diffstat (limited to 'files.c')
| -rw-r--r-- | files.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -18,6 +18,8 @@ __attribute__((nonnull)) static void populate_lines(file_t *f); +__attribute__((pure, nonnull)) +static size_t get_char_number(file_t *f, const char *p); // // In the file object, populate the `lines` array with pointers to the @@ -185,7 +187,7 @@ size_t get_line_number(file_t *f, const char *p) // // Given a pointer, determine which character offset within the line it points to. // -size_t get_char_number(file_t *f, const char *p) +static size_t get_char_number(file_t *f, const char *p) { size_t linenum = get_line_number(f, p); return 1 + (size_t)(p - f->lines[linenum-1]); |
