@@ -38,7 +38,8 @@ ft_wrap_quit(pgFontObject *);
38
38
*
39
39
*********************************************************/
40
40
void
41
- _PGFT_SetError (FreeTypeInstance * ft , const char * error_msg , FT_Error error_id ){
41
+ _PGFT_SetError (FreeTypeInstance * ft , const char * error_msg , FT_Error error_id )
42
+ {
42
43
#undef __FTERRORS_H__
43
44
#define FT_ERRORDEF (e , v , s ) {e, s},
44
45
#define FT_ERROR_START_LIST {
@@ -48,37 +49,37 @@ _PGFT_SetError(FreeTypeInstance *ft, const char *error_msg, FT_Error error_id){
48
49
} \
49
50
} \
50
51
;
51
- static const struct {int err_code ;
52
- const char * err_msg ;
53
- }
54
- ft_errors [] =
52
+ static const struct {
53
+ int err_code ;
54
+ const char * err_msg ;
55
+ } ft_errors [] =
55
56
#include FT_ERRORS_H
56
57
57
- const int maxlen = (int )(sizeof (ft -> _error_msg )) - 1 ;
58
- int i ;
59
- const char * ft_msg ;
58
+ const int maxlen = (int )(sizeof (ft -> _error_msg )) - 1 ;
59
+ int i ;
60
+ const char * ft_msg ;
60
61
61
- ft_msg = 0 ;
62
- for (i = 0 ; ft_errors [i ].err_msg ; ++ i ) {
63
- if (error_id == ft_errors [i ].err_code ) {
64
- ft_msg = ft_errors [i ].err_msg ;
65
- break ;
62
+ ft_msg = 0 ;
63
+ for (i = 0 ; ft_errors [i ].err_msg ; ++ i ) {
64
+ if (error_id == ft_errors [i ].err_code ) {
65
+ ft_msg = ft_errors [i ].err_msg ;
66
+ break ;
67
+ }
66
68
}
67
- }
68
69
69
- if (error_id && ft_msg ) {
70
- int ret = PyOS_snprintf (ft -> _error_msg , sizeof (ft -> _error_msg ), "%.*s: %s" ,
71
- maxlen - 3 , error_msg , ft_msg );
72
- if (ret >= 0 ) {
73
- /* return after successfully copying full or truncated error.
74
- * If ret < 0, PyOS_snprintf failed so try to strncpy error
75
- * message */
76
- return ;
70
+ if (error_id && ft_msg ) {
71
+ int ret = PyOS_snprintf (ft -> _error_msg , sizeof (ft -> _error_msg ),
72
+ "%.*s: %s" , maxlen - 3 , error_msg , ft_msg );
73
+ if (ret >= 0 ) {
74
+ /* return after successfully copying full or truncated error.
75
+ * If ret < 0, PyOS_snprintf failed so try to strncpy error
76
+ * message */
77
+ return ;
78
+ }
77
79
}
78
- }
79
80
80
- strncpy (ft -> _error_msg , error_msg , maxlen );
81
- ft -> _error_msg [maxlen ] = '\0' ; /* in case of message truncation */
81
+ strncpy (ft -> _error_msg , error_msg , maxlen );
82
+ ft -> _error_msg [maxlen ] = '\0' ; /* in case of message truncation */
82
83
}
83
84
84
85
const char *
0 commit comments