From c17ca10e11db30f4b4924b69dbf3b1693025d4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 13 Sep 2014 22:25:06 +0200 Subject: Introduce and use EPOS instead of (size_t)-1 --- text.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text.h') diff --git a/text.h b/text.h index 0dadbb6..f8b66ee 100644 --- a/text.h +++ b/text.h @@ -4,6 +4,8 @@ #include #include +#define EPOS ((size_t)-1) /* invalid position */ + typedef size_t Filepos; typedef struct { @@ -36,7 +38,7 @@ bool text_insert_raw(Text*, size_t pos, const char *data, size_t len); bool text_delete(Text*, size_t pos, size_t len); void text_snapshot(Text*); /* undo/redos to the last snapshoted state. returns the position where - * the change occured or (size_t)-1 if nothing could be undo/redo. */ + * the change occured or EPOS if nothing could be undo/redo. */ size_t text_undo(Text*); size_t text_redo(Text*); -- cgit v1.2.3