good for merge

regards
-steve

On Mon, 2009-04-06 at 19:02 +0200, Jim Meyering wrote:
> 
> From 52bcf255865884528376178acf83d67dcdcd701b Mon Sep 17 00:00:00 2001
> From: Jim Meyering <[email protected]>
> Date: Mon, 6 Apr 2009 18:57:27 +0200
> 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.
> ---
>  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 62cc5af..a03f300 100644
> --- a/exec/util.h
> +++ b/exec/util.h
> @@ -7,7 +7,7 @@
>   * Author: Steven Dake ([email protected]), Mark Haverkamp ([email protected])
>   *
>   * 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 16199ba..237aeb8 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 ([email protected])
>   *
>   * 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;

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to