Ver código fonte

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

master
ooxi 12 anos atrás
pai
commit
a78e8db5b1
2 arquivos alterados com 2 adições e 5 exclusões
  1. +1
    -2
      src/xml.c
  2. +1
    -3
      test/test-xml.c

+ 1
- 2
src/xml.c Ver arquivo

@@ -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 Ver arquivo

@@ -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;






Carregando…
Cancelar
Salvar