Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1a8ae907
Commit
1a8ae907
authored
Feb 05, 2011
by
Paul Eggert
Browse files
Merge: xstrcasecmp: conform to C89 pointer rules
parents
36539990
25a48bd0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
30 deletions
+36
-30
src/ChangeLog
src/ChangeLog
+5
-0
src/dispextern.h
src/dispextern.h
+1
-2
src/font.c
src/font.c
+3
-3
src/fontset.c
src/fontset.c
+1
-1
src/ftfont.c
src/ftfont.c
+3
-3
src/image.c
src/image.c
+2
-2
src/process.c
src/process.c
+2
-2
src/xfaces.c
src/xfaces.c
+17
-15
src/xfont.c
src/xfont.c
+2
-2
No files found.
src/ChangeLog
View file @
1a8ae907
2011-02-05 Paul Eggert <eggert@cs.ucla.edu>
xstrcasecmp: conform to C89 pointer rules
* xfaces.c (xstrcasecmp): Change args from const unsigned char *
to const char *, since they're usually low-level C strings, and
this stays compatible with C89 pointer rules. All callers changed.
* charset.c: conform to C89 pointer rules
(define_charset_internal): Switch between char * and unsigned char *.
src/dispextern.h
View file @
1a8ae907
...
...
@@ -3151,7 +3151,7 @@ char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
int
*
);
int
ascii_face_of_lisp_face
(
struct
frame
*
,
int
);
void
prepare_face_for_display
(
struct
frame
*
,
struct
face
*
);
int
xstrcasecmp
(
const
unsigned
char
*
,
const
unsigned
char
*
);
int
xstrcasecmp
(
const
char
*
,
const
char
*
);
int
lookup_named_face
(
struct
frame
*
,
Lisp_Object
,
int
);
int
lookup_basic_face
(
struct
frame
*
,
int
);
int
smaller_face
(
struct
frame
*
,
int
,
int
);
...
...
@@ -3361,4 +3361,3 @@ extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object,
#endif
/* HAVE_WINDOW_SYSTEM */
#endif
/* not DISPEXTERN_H_INCLUDED */
src/font.c
View file @
1a8ae907
...
...
@@ -315,7 +315,7 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror
if
(
SYMBOLP
(
val
))
{
unsigned
char
*
s
;
char
*
s
;
Lisp_Object
args
[
2
],
elt
;
/* At first try exact match. */
...
...
@@ -325,12 +325,12 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror
return
((
XINT
(
AREF
(
AREF
(
table
,
i
),
0
))
<<
8
)
|
(
i
<<
4
)
|
(
j
-
1
));
/* Try also with case-folding match. */
s
=
SDATA
(
SYMBOL_NAME
(
val
));
s
=
S
SDATA
(
SYMBOL_NAME
(
val
));
for
(
i
=
0
;
i
<
len
;
i
++
)
for
(
j
=
1
;
j
<
ASIZE
(
AREF
(
table
,
i
));
j
++
)
{
elt
=
AREF
(
AREF
(
table
,
i
),
j
);
if
(
xstrcasecmp
(
s
,
SDATA
(
SYMBOL_NAME
(
elt
)))
==
0
)
if
(
xstrcasecmp
(
s
,
S
SDATA
(
SYMBOL_NAME
(
elt
)))
==
0
)
return
((
XINT
(
AREF
(
AREF
(
table
,
i
),
0
))
<<
8
)
|
(
i
<<
4
)
|
(
j
-
1
));
}
...
...
src/fontset.c
View file @
1a8ae907
...
...
@@ -1166,7 +1166,7 @@ fs_query_fontset (Lisp_Object name, int name_pattern)
this_name
=
FONTSET_NAME
(
fontset
);
if
(
name_pattern
==
1
?
fast_string_match_ignore_case
(
name
,
this_name
)
>=
0
:
!
xstrcasecmp
(
SDATA
(
name
),
SDATA
(
this_name
)))
:
!
xstrcasecmp
(
S
SDATA
(
name
),
S
SDATA
(
this_name
)))
return
i
;
}
return
-
1
;
...
...
src/ftfont.c
View file @
1a8ae907
...
...
@@ -1022,12 +1022,12 @@ ftfont_list (Lisp_Object frame, Lisp_Object spec)
if
(
!
NILP
(
adstyle
)
&&
(
NILP
(
this_adstyle
)
||
xstrcasecmp
(
SDATA
(
SYMBOL_NAME
(
adstyle
)),
SDATA
(
SYMBOL_NAME
(
this_adstyle
)))
!=
0
))
||
xstrcasecmp
(
S
SDATA
(
SYMBOL_NAME
(
adstyle
)),
S
SDATA
(
SYMBOL_NAME
(
this_adstyle
)))
!=
0
))
continue
;
if
(
langname
&&
!
NILP
(
this_adstyle
)
&&
xstrcasecmp
(
langname
,
SDATA
(
SYMBOL_NAME
(
this_adstyle
))))
&&
xstrcasecmp
(
langname
,
S
SDATA
(
SYMBOL_NAME
(
this_adstyle
))))
continue
;
}
entity
=
ftfont_pattern_entity
(
fontset
->
fonts
[
i
],
...
...
src/image.c
View file @
1a8ae907
...
...
@@ -3906,7 +3906,7 @@ xpm_load_image (struct frame *f,
while (num_colors-- > 0)
{
unsigned
char *color, *max_color;
char *color, *max_color;
int key, next_key, max_key = 0;
Lisp_Object symbol_color = Qnil, color_val;
XColor cdef;
...
...
@@ -3958,7 +3958,7 @@ xpm_load_image (struct frame *f,
if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
{
if (xstrcasecmp (SDATA (XCDR (specified_color)), "None") == 0)
if (xstrcasecmp (
S
SDATA (XCDR (specified_color)), "None") == 0)
color_val = Qt;
else if (x_defined_color (f, SDATA (XCDR (specified_color)),
&cdef, 0))
...
...
src/process.c
View file @
1a8ae907
...
...
@@ -6168,10 +6168,10 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
;
else
{
unsigned
char *name;
char *name;
CHECK_SYMBOL (sigcode);
name = SDATA (SYMBOL_NAME (sigcode));
name =
S
SDATA (SYMBOL_NAME (sigcode));
if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3))
name += 3;
...
...
src/xfaces.c
View file @
1a8ae907
...
...
@@ -716,12 +716,14 @@ x_free_gc (struct frame *f, GC gc)
are in ISO8859-1. */
int
xstrcasecmp
(
const
unsigned
char
*
s1
,
const
unsigned
char
*
s2
)
xstrcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
while
(
*
s1
&&
*
s2
)
{
unsigned
char
c1
=
tolower
(
*
s1
);
unsigned
char
c2
=
tolower
(
*
s2
);
unsigned
char
b1
=
*
s1
;
unsigned
char
b2
=
*
s2
;
unsigned
char
c1
=
tolower
(
b1
);
unsigned
char
c2
=
tolower
(
b2
);
if
(
c1
!=
c2
)
return
c1
<
c2
?
-
1
:
1
;
++
s1
,
++
s2
;
...
...
@@ -3466,13 +3468,13 @@ face_boolean_x_resource_value (Lisp_Object value, int signal_p)
xassert
(
STRINGP
(
value
));
if
(
xstrcasecmp
(
SDATA
(
value
),
"on"
)
==
0
||
xstrcasecmp
(
SDATA
(
value
),
"true"
)
==
0
)
if
(
xstrcasecmp
(
S
SDATA
(
value
),
"on"
)
==
0
||
xstrcasecmp
(
S
SDATA
(
value
),
"true"
)
==
0
)
result
=
Qt
;
else
if
(
xstrcasecmp
(
SDATA
(
value
),
"off"
)
==
0
||
xstrcasecmp
(
SDATA
(
value
),
"false"
)
==
0
)
else
if
(
xstrcasecmp
(
S
SDATA
(
value
),
"off"
)
==
0
||
xstrcasecmp
(
S
SDATA
(
value
),
"false"
)
==
0
)
result
=
Qnil
;
else
if
(
xstrcasecmp
(
SDATA
(
value
),
"unspecified"
)
==
0
)
else
if
(
xstrcasecmp
(
S
SDATA
(
value
),
"unspecified"
)
==
0
)
result
=
Qunspecified
;
else
if
(
signal_p
)
signal_error
(
"Invalid face attribute value from X resource"
,
value
);
...
...
@@ -3491,7 +3493,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
CHECK_SYMBOL
(
attr
);
CHECK_STRING
(
value
);
if
(
xstrcasecmp
(
SDATA
(
value
),
"unspecified"
)
==
0
)
if
(
xstrcasecmp
(
S
SDATA
(
value
),
"unspecified"
)
==
0
)
value
=
Qunspecified
;
else
if
(
EQ
(
attr
,
QCheight
))
{
...
...
@@ -4051,10 +4053,10 @@ lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
{
xassert
(
lface_fully_specified_p
(
lface1
)
&&
lface_fully_specified_p
(
lface2
));
return
(
xstrcasecmp
(
SDATA
(
lface1
[
LFACE_FAMILY_INDEX
]),
SDATA
(
lface2
[
LFACE_FAMILY_INDEX
]))
==
0
&&
xstrcasecmp
(
SDATA
(
lface1
[
LFACE_FOUNDRY_INDEX
]),
SDATA
(
lface2
[
LFACE_FOUNDRY_INDEX
]))
==
0
return
(
xstrcasecmp
(
S
SDATA
(
lface1
[
LFACE_FAMILY_INDEX
]),
S
SDATA
(
lface2
[
LFACE_FAMILY_INDEX
]))
==
0
&&
xstrcasecmp
(
S
SDATA
(
lface1
[
LFACE_FOUNDRY_INDEX
]),
S
SDATA
(
lface2
[
LFACE_FOUNDRY_INDEX
]))
==
0
&&
EQ
(
lface1
[
LFACE_HEIGHT_INDEX
],
lface2
[
LFACE_HEIGHT_INDEX
])
&&
EQ
(
lface1
[
LFACE_SWIDTH_INDEX
],
lface2
[
LFACE_SWIDTH_INDEX
])
&&
EQ
(
lface1
[
LFACE_WEIGHT_INDEX
],
lface2
[
LFACE_WEIGHT_INDEX
])
...
...
@@ -4063,8 +4065,8 @@ lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
&&
(
EQ
(
lface1
[
LFACE_FONTSET_INDEX
],
lface2
[
LFACE_FONTSET_INDEX
])
||
(
STRINGP
(
lface1
[
LFACE_FONTSET_INDEX
])
&&
STRINGP
(
lface2
[
LFACE_FONTSET_INDEX
])
&&
!
xstrcasecmp
(
SDATA
(
lface1
[
LFACE_FONTSET_INDEX
]),
SDATA
(
lface2
[
LFACE_FONTSET_INDEX
]))))
&&
!
xstrcasecmp
(
S
SDATA
(
lface1
[
LFACE_FONTSET_INDEX
]),
S
SDATA
(
lface2
[
LFACE_FONTSET_INDEX
]))))
);
}
...
...
src/xfont.c
View file @
1a8ae907
...
...
@@ -164,8 +164,8 @@ xfont_get_cache (FRAME_PTR f)
static
int
compare_font_names
(
const
void
*
name1
,
const
void
*
name2
)
{
return
xstrcasecmp
(
*
(
const
unsigned
char
**
)
name1
,
*
(
const
unsigned
char
**
)
name2
);
return
xstrcasecmp
(
*
(
const
char
**
)
name1
,
*
(
const
char
**
)
name2
);
}
/* Decode XLFD as iso-8859-1 into OUTPUT, and return the byte length
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment