Add const qualifier to md5_file and alpm_get_md5sum
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
3acbf56bba
commit
942175feaa
4 changed files with 8 additions and 6 deletions
|
@ -379,7 +379,7 @@ const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* checksums */
|
/* checksums */
|
||||||
char *alpm_get_md5sum(char *name);
|
char *alpm_get_md5sum(const char *name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Errors
|
* Errors
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
* * removal of HMAC code
|
* * removal of HMAC code
|
||||||
* * removal of SELF_TEST code
|
* * removal of SELF_TEST code
|
||||||
* * removal of ipad and opad from the md5_context struct in md5.h
|
* * removal of ipad and opad from the md5_context struct in md5.h
|
||||||
|
* * change of md5_file prototype from
|
||||||
|
* int md5_file( char *path, unsigned char *output )
|
||||||
|
* to
|
||||||
|
* int md5_file( const char *path, unsigned char *output )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CRT_SECURE_NO_DEPRECATE
|
#ifndef _CRT_SECURE_NO_DEPRECATE
|
||||||
|
@ -301,7 +305,7 @@ void md5( unsigned char *input, int ilen,
|
||||||
/*
|
/*
|
||||||
* Output = MD5( file contents )
|
* Output = MD5( file contents )
|
||||||
*/
|
*/
|
||||||
int md5_file( char *path, unsigned char *output )
|
int md5_file( const char *path, unsigned char *output )
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
|
@ -82,7 +82,7 @@ void md5( unsigned char *input, int ilen,
|
||||||
* \return 0 if successful, 1 if fopen failed,
|
* \return 0 if successful, 1 if fopen failed,
|
||||||
* or 2 if fread failed
|
* or 2 if fread failed
|
||||||
*/
|
*/
|
||||||
int md5_file( char *path, unsigned char *output );
|
int md5_file( const char *path, unsigned char *output );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,7 +547,7 @@ int _alpm_str_cmp(const void *s1, const void *s2)
|
||||||
* @return the checksum on success, NULL on error
|
* @return the checksum on success, NULL on error
|
||||||
* @addtogroup alpm_misc
|
* @addtogroup alpm_misc
|
||||||
*/
|
*/
|
||||||
char SYMEXPORT *alpm_get_md5sum(char *filename)
|
char SYMEXPORT *alpm_get_md5sum(const char *filename)
|
||||||
{
|
{
|
||||||
unsigned char output[16];
|
unsigned char output[16];
|
||||||
char *md5sum;
|
char *md5sum;
|
||||||
|
@ -582,6 +582,4 @@ char SYMEXPORT *alpm_get_md5sum(char *filename)
|
||||||
return(md5sum);
|
return(md5sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|
Loading…
Add table
Reference in a new issue