File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ static const char * const bch2_errcode_strs[] = {
13
13
NULL
14
14
};
15
15
16
- static unsigned bch2_errcode_parents [] = {
16
+ static const unsigned bch2_errcode_parents [] = {
17
17
#define x (class , err ) [BCH_ERR_ ##err - BCH_ERR_START ] = class ,
18
18
BCH_ERRCODES ()
19
19
#undef x
20
20
};
21
21
22
+ __attribute__((const ))
22
23
const char * bch2_err_str (int err )
23
24
{
24
25
const char * errstr ;
@@ -36,6 +37,7 @@ const char *bch2_err_str(int err)
36
37
return errstr ?: "(Invalid error)" ;
37
38
}
38
39
40
+ __attribute__((const ))
39
41
bool __bch2_err_matches (int err , int class )
40
42
{
41
43
err = abs (err );
Original file line number Diff line number Diff line change @@ -357,9 +357,11 @@ enum bch_errcode {
357
357
BCH_ERR_MAX
358
358
};
359
359
360
- const char * bch2_err_str (int );
361
- bool __bch2_err_matches (int , int );
360
+ __attribute__((const )) const char * bch2_err_str (int );
362
361
362
+ __attribute__((const )) bool __bch2_err_matches (int , int );
363
+
364
+ __attribute__((const ))
363
365
static inline bool _bch2_err_matches (int err , int class )
364
366
{
365
367
return err < 0 && __bch2_err_matches (err , class );
You can’t perform that action at this time.
0 commit comments