From 3239b3cb6957aa5f5f04c9d7d9035da14ccd0741 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 15 Sep 2016 14:05:15 -0400 Subject: use size_t for indexes protect against incorrect copies in debug mode --- src/errmsg.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/errmsg.hpp') diff --git a/src/errmsg.hpp b/src/errmsg.hpp index b16249ec0b..e8b2f5872d 100644 --- a/src/errmsg.hpp +++ b/src/errmsg.hpp @@ -18,8 +18,8 @@ enum ErrColor { }; struct ErrorMsg { - int line_start; - int column_start; + size_t line_start; + size_t column_start; Buf *msg; Buf *path; Buf line_buf; @@ -30,10 +30,10 @@ struct ErrorMsg { void print_err_msg(ErrorMsg *msg, ErrColor color); void err_msg_add_note(ErrorMsg *parent, ErrorMsg *note); -ErrorMsg *err_msg_create_with_offset(Buf *path, int line, int column, int offset, +ErrorMsg *err_msg_create_with_offset(Buf *path, size_t line, size_t column, size_t offset, const char *source, Buf *msg); -ErrorMsg *err_msg_create_with_line(Buf *path, int line, int column, - Buf *source, ZigList *line_offsets, Buf *msg); +ErrorMsg *err_msg_create_with_line(Buf *path, size_t line, size_t column, + Buf *source, ZigList *line_offsets, Buf *msg); #endif -- cgit v1.2.3