From: Philippe Waroquiers Date: Sat, 9 Aug 2014 11:26:51 +0000 (+0000) Subject: Mark argument of VG_(mkstemp) as const. X-Git-Tag: svn/VALGRIND_3_10_0~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c160835f7f38294d5090411e7f8d0dd44d14c3fa;p=thirdparty%2Fvalgrind.git Mark argument of VG_(mkstemp) as const. Fix comment in pub_core_libcfile.h (and make it the only copy) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14247 --- diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 9ff6b61004..d42128e1a0 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -721,12 +721,7 @@ SizeT VG_(mkstemp_fullname_bufsz) ( SizeT part_of_name_len ) } -/* Create and open (-rw------) a tmp file name incorporating said arg. - Returns -1 on failure, else the fd of the file. If fullname is - non-NULL, the file's name is written into it. The number of bytes - written is equal to VG_(mkstemp_fullname_bufsz)(part_of_name). */ - -Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname ) +Int VG_(mkstemp) ( const HChar* part_of_name, /*OUT*/HChar* fullname ) { HChar buf[VG_(mkstemp_fullname_bufsz)(VG_(strlen)(part_of_name))]; Int n, tries, fd; diff --git a/coregrind/pub_core_libcfile.h b/coregrind/pub_core_libcfile.h index f27725b85a..d3bd68069a 100644 --- a/coregrind/pub_core_libcfile.h +++ b/coregrind/pub_core_libcfile.h @@ -95,9 +95,9 @@ extern SizeT VG_(mkstemp_fullname_bufsz) ( SizeT part_of_name_len ); /* Create and open (-rw------) a tmp file name incorporating said arg. Returns -1 on failure, else the fd of the file. If fullname is - non-NULL, the file's name is written into it. The number of bytes - written is equal to VG_(mkstemp_fullname_bufsz)(part_of_name). */ -extern Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname ); + non-NULL, the file's name is written into it. The number of bytes written + is equal to VG_(mkstemp_fullname_bufsz)(VG_(strlen)(part_of_name)). */ +extern Int VG_(mkstemp) ( const HChar* part_of_name, /*OUT*/HChar* fullname ); /* Record the process' working directory at startup. Is intended to be called exactly once, at startup, before the working directory