From a09eabeb4d772d9b8afd7f7134c1be37ca8ea150 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 1 Apr 2020 21:17:13 +0900 Subject: [PATCH] [qfcc] Fix some const attribute warnings Try to anticipate gcc's warnings and it one-ups you :P --- tools/qfcc/include/class.h | 8 ++++---- tools/qfcc/source/stub.c | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/qfcc/include/class.h b/tools/qfcc/include/class.h index 048ae8227..ec160e1d9 100644 --- a/tools/qfcc/include/class.h +++ b/tools/qfcc/include/class.h @@ -119,10 +119,10 @@ int is_id (const struct type_s *type) __attribute__((pure)); int is_class (const struct type_s *type) __attribute__((pure)); int is_Class (const struct type_s *type) __attribute__((const)); int is_classptr (const struct type_s *type) __attribute__((pure)); -int is_SEL (const struct type_s *type) __attribute__((pure)); -int is_object (const struct type_s *type) __attribute__((pure)); -int is_method (const struct type_s *type) __attribute__((pure)); -int is_method_description (const struct type_s *type) __attribute__((pure)); +int is_SEL (const struct type_s *type) __attribute__((const)); +int is_object (const struct type_s *type) __attribute__((const)); +int is_method (const struct type_s *type) __attribute__((const)); +int is_method_description (const struct type_s *type) __attribute__((const)); int obj_types_assignable (const struct type_s *dst, const struct type_s *src); class_t *extract_class (class_type_t *class_type) __attribute__((pure)); diff --git a/tools/qfcc/source/stub.c b/tools/qfcc/source/stub.c index b7d73cd68..449e62436 100644 --- a/tools/qfcc/source/stub.c +++ b/tools/qfcc/source/stub.c @@ -53,5 +53,6 @@ int compare_protocols (protocollist_t *protos1, protocollist_t *protos2){return void dump_dot (const char *stage, void *data, void (*dump_func) (void *data, const char *fname)){} void dump_dot_type (void *_t, const char *filename){} -const char *strip_path(const char *p) { return p;} -const char *file_basename(const char *p, int keepdot) { return p;} +char *fubar; +const char *strip_path(const char *p) { return fubar;} +const char *file_basename(const char *p, int keepdot) { return fubar;}