From 8defaf0c3f47559b11a31564d9968d495b82b434 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 7 Apr 2009 13:03:30 +0000 Subject: [PATCH] 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 --- exec/util.h | 4 +--- include/corosync/mar_gen.h | 14 +++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/exec/util.h b/exec/util.h index 62cc5afb..a03f3008 100644 --- a/exec/util.h +++ b/exec/util.h @@ -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 */ diff --git a/include/corosync/mar_gen.h b/include/corosync/mar_gen.h index 16199ba9..237aeb8a 100644 --- a/include/corosync/mar_gen.h +++ b/include/corosync/mar_gen.h @@ -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;