X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Ftmpfile.c;h=aff135d0cc0a1c27b0ea9af1d58dec6beb08d19a;hb=98c1a7bd8ec44126321ccca829bed44f7e77c26a;hp=0d3093646faa6a9d20a941048760f0d0d11d8be6;hpb=07623ede4f56d27643c0c0ac978c089690f350c0;p=pspp diff --git a/src/libpspp/tmpfile.c b/src/libpspp/tmpfile.c index 0d3093646f..aff135d0cc 100644 --- a/src/libpspp/tmpfile.c +++ b/src/libpspp/tmpfile.c @@ -26,6 +26,7 @@ #include #include +#include #include "error.h" #include "xalloc.h" @@ -81,7 +82,7 @@ tmpfile_destroy (struct tmpfile *tf) static bool do_seek (const struct tmpfile *tf_, off_t offset) { - struct tmpfile *tf = (struct tmpfile *) tf_; + struct tmpfile *tf = CONST_CAST (struct tmpfile *, tf_); if (!tmpfile_error (tf)) { @@ -106,7 +107,7 @@ do_seek (const struct tmpfile *tf_, off_t offset) static bool do_read (const struct tmpfile *tf_, void *buffer, size_t bytes) { - struct tmpfile *tf = (struct tmpfile *) tf_; + struct tmpfile *tf = CONST_CAST (struct tmpfile *, tf_); assert (!tmpfile_error (tf)); if (bytes > 0 && fread (buffer, bytes, 1, tf->file) != 1)