ソースを参照

Dunno what I changed...

master
コミット
2045f178cc
2個のファイルの変更11行の追加17行の削除
  1. +10
    -16
      xtandard.c
  2. +1
    -1
      xtandard.h

+ 10
- 16
xtandard.c ファイルの表示

@@ -573,31 +573,25 @@ int character_compare_array (char character, char * character_array) {
return (0);
}

int character_count (char * string, int from, int to, char this, char stop) {
int character_count (char * string, char this, int from, int to, char stop) {
int count;

for (count = 0; (from != to) && (string [from] != stop); from += (int) ((to < from) ? -1 : 1)) {
count += (int) ((string [from] == this) || (this == '\0'));
}
/*
if (to < from) {
for (count = 0; to < from; --from) {
if ((string [from] == this) || (this == '\0')) {
++count;
}
if (string [from] == stop) {
break;
}
for (count = 0; (to < from) && (string [from] != stop); --from) {
count += (int) ((string [from] == this) || (this == '\0'));
}
} else if (from < to) {
for (count = 0; from < to; ++from) {
if (string [from] == this) {
++count;
}
if (string [from] == stop) {
break;
}
for (count = 0; (from < to) && (string [from] != stop); ++from) {
count += (int) ((string [from] == this) || (this == '\0'));
}
} else {
count = 0;
}
*/
return (count);
}



+ 1
- 1
xtandard.h ファイルの表示

@@ -106,7 +106,7 @@ extern int character_is_hexadecimal (char character);

extern int character_compare_array (char character, char * character_array);

extern int character_count (char * string, int from, int to, char this, char stop);
extern int character_count (char * string, char this, int from, int to, char stop);

extern int string_length (char * string);



読み込み中…
キャンセル
保存