Procházet zdrojové kódy

Use stdbool.h instead of manually specifing true and false :-D

master
ooxi před 11 roky
rodič
revize
a78e8db5b1
2 změnil soubory, kde provedl 2 přidání a 5 odebrání
  1. +1
    -2
      src/xml.c
  2. +1
    -3
      test/test-xml.c

+ 1
- 2
src/xml.c Zobrazit soubor

@@ -22,6 +22,7 @@
*/
#include <ctype.h>
#include <malloc.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "xml.h"
@@ -117,8 +118,6 @@ static size_t get_zero_terminated_array_elements(struct xml_node** nodes) {
* @return true gdw. a == b
*/
static _Bool xml_string_equals(struct xml_string* a, struct xml_string* b) {
_Bool const true = 1;
_Bool const false = 0;

if (a->length != b->length) {
return false;


+ 1
- 3
test/test-xml.c Zobrazit soubor

@@ -20,13 +20,11 @@
*
* 3. This notice may not be removed or altered from any source distribution.
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <xml.h>

static _Bool true = 1;
static _Bool false = 0;






Načítá se…
Zrušit
Uložit