~cody.smith/ubuntu/precise/freeciv/lp.202327

« back to all changes in this revision

Viewing changes to utility/support.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2010-12-16 20:44:14 UTC
  • mfrom: (1.2.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20101216204414-gcr7omy0o66x5nzo
Tags: 2.2.4-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
847
847
****************************************************************************/
848
848
bool my_isalnum(char c)
849
849
{
850
 
  if (c < 0 || c >= 128) {
 
850
  if (128 <= (unsigned char) c) {
851
851
    return FALSE;
852
852
  }
853
853
  return isalnum((int)((unsigned char)c)) != 0;
858
858
****************************************************************************/
859
859
bool my_isalpha(char c)
860
860
{
861
 
  if (c < 0 || c >= 128) {
 
861
  if (128 <= (unsigned char) c) {
862
862
    return FALSE;
863
863
  }
864
864
  return isalpha((int)((unsigned char)c)) != 0;
869
869
****************************************************************************/
870
870
bool my_isdigit(char c)
871
871
{
872
 
  if (c < 0 || c >= 128) {
 
872
  if (128 <= (unsigned char) c) {
873
873
    return FALSE;
874
874
  }
875
875
  return isdigit((int)((unsigned char)c)) != 0;
880
880
****************************************************************************/
881
881
bool my_isprint(char c)
882
882
{
883
 
  if (c < 0 || c >= 128) {
 
883
  if (128 <= (unsigned char) c) {
884
884
    return FALSE;
885
885
  }
886
886
  return isprint((int)((unsigned char)c)) != 0;
891
891
****************************************************************************/
892
892
bool my_isspace(char c)
893
893
{
894
 
  if (c < 0 || c >= 128) {
 
894
  if (128 <= (unsigned char) c) {
895
895
    return FALSE;
896
896
  }
897
897
  return isspace((int)((unsigned char)c)) != 0;
902
902
****************************************************************************/
903
903
bool my_isupper(char c)
904
904
{
905
 
  if (c < 0 || c >= 128) {
 
905
  if (128 <= (unsigned char) c) {
906
906
    return FALSE;
907
907
  }
908
908
  return isupper((int)((unsigned char)c)) != 0;
913
913
****************************************************************************/
914
914
char my_toupper(char c)
915
915
{
916
 
  if (c < 0 || c >= 128) {
 
916
  if (128 <= (unsigned char) c) {
917
917
    return c;
918
918
  }
919
919
  return (char) toupper((int)((unsigned char)c));
924
924
****************************************************************************/
925
925
char my_tolower(char c)
926
926
{
927
 
  if (c < 0 || c >= 128) {
 
927
  if (128 <= (unsigned char) c) {
928
928
    return c;
929
929
  }
930
930
  return (char) tolower((int)((unsigned char)c));