mar_gen.h: make params const

* include/corosync/mar_gen.h (get_mar_name_t, mar_name_match): const
* exec/util.h (get_mar_name_t, mar_name_match): Remove unneeded decls.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2013 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Jim Meyering 2009-04-07 13:03:30 +00:00
parent eb5919f0cc
commit 8defaf0c3f
2 changed files with 8 additions and 10 deletions

View File

@ -7,7 +7,7 @@
* Author: Steven Dake (sdake@redhat.com), Mark Haverkamp (markh@osdl.org)
*
* This software licensed under BSD license, the text of which follows:
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@ -67,7 +67,6 @@ enum e_ais_done {
* Compare two names. returns non-zero on match.
*/
extern int name_match(cs_name_t *name1, cs_name_t *name2);
extern int mar_name_match(mar_name_t *name1, mar_name_t *name2);
#define corosync_exit_error(err) _corosync_exit_error ((err), __FILE__, __LINE__)
extern void _corosync_exit_error (enum e_ais_done err, const char *file,
unsigned int line)
@ -76,6 +75,5 @@ void _corosync_out_of_memory_error (void) __attribute__((__noreturn__));
extern char *getcs_name_t (cs_name_t *name);
extern char *strstr_rs (const char *haystack, const char *needle);
extern void setcs_name_t (cs_name_t *name, char *str);
char *get_mar_name_t (mar_name_t *name);
extern int cs_name_tisEqual (cs_name_t *str1, char *str2);
#endif /* UTIL_H_DEFINED */

View File

@ -1,13 +1,12 @@
/*
* Copyright (C) 2006, 2009 Red Hat, Inc.
* Copyright (c) 2006-2008 Red Hat, Inc.
* Copyright (c) 2006-2009 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Steven Dake (sdake@redhat.com)
*
* This software licensed under BSD license, the text of which follows:
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@ -101,14 +100,15 @@ typedef struct {
mar_uint8_t value[CS_MAX_NAME_LENGTH] __attribute__((aligned(8)));
} mar_name_t;
static inline char *get_mar_name_t (mar_name_t *name) {
return ((char *)name->value);
static inline const char *get_mar_name_t (const mar_name_t *name) {
return ((const char *)name->value);
}
static inline int mar_name_match(mar_name_t *name1, mar_name_t *name2)
static inline int mar_name_match(const mar_name_t *name1, const mar_name_t *name2)
{
if (name1->length == name2->length) {
return ((strncmp ((char *)name1->value, (char *)name2->value,
return ((strncmp ((const char *)name1->value,
(const char *)name2->value,
name1->length)) == 0);
}
return 0;