Skip to content

Commit f79eb3b

Browse files
committed
Add __attribute__((sentinel)) to all vcard_*_vanew function declarations
1 parent 0c4a9f5 commit f79eb3b

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

src/libicalvcard/vcardcomponent.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef VCARDCOMPONENT_H
1313
#define VCARDCOMPONENT_H
1414

15+
#include "libical_sentinel.h"
1516
#include "libical_vcard_export.h"
1617
#include "vcardproperty.h"
1718
#include "pvl.h"
@@ -45,7 +46,7 @@ LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_new_from_string(const char *
4546

4647
/** @brief Constructor
4748
*/
48-
LIBICAL_VCARD_EXPORT vcardcomponent *vcardcomponent_vanew(vcardcomponent_kind kind, ...);
49+
LIBICAL_VCARD_EXPORT LIBICAL_SENTINEL vcardcomponent *vcardcomponent_vanew(vcardcomponent_kind kind, ...);
4950

5051
/*** @brief Destructor
5152
*/

src/libicalvcard/vcardderivedproperty.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef VCARDDERIVEDPROPERTY_H
1313
#define VCARDDERIVEDPROPERTY_H
1414

15+
#include "libical_sentinel.h"
1516
#include "vcardderivedvalue.h"
1617
#include "vcardparameter.h"
1718

src/libicalvcard/vcardvalue.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static vcardvalue *vcardvalue_new_from_string_with_error(vcardvalue_kind kind,
313313
"Could not parse %s as a %s property",
314314
str, vcardvalue_kind_to_string(kind));
315315
errParam = vcardparameter_new_xlicerrortype(VCARD_XLICERRORTYPE_VALUEPARSEERROR);
316-
*error = vcardproperty_vanew_xlicerror(temp, errParam, 0);
316+
*error = vcardproperty_vanew_xlicerror(temp, errParam, (void *) 0);
317317
vcardparameter_free(errParam);
318318
}
319319
break;
@@ -377,7 +377,7 @@ static vcardvalue *vcardvalue_new_from_string_with_error(vcardvalue_kind kind,
377377
"Could not parse %s as a %s property",
378378
str, vcardvalue_kind_to_string(kind));
379379
errParam = vcardparameter_new_xlicerrortype(VCARD_XLICERRORTYPE_VALUEPARSEERROR);
380-
*error = vcardproperty_vanew_xlicerror(temp, errParam, 0);
380+
*error = vcardproperty_vanew_xlicerror(temp, errParam, (void *) 0);
381381
vcardparameter_free(errParam);
382382
}
383383
break;
@@ -478,7 +478,7 @@ static vcardvalue *vcardvalue_new_from_string_with_error(vcardvalue_kind kind,
478478
snprintf(temp, TMP_BUF_SIZE, "Unknown type for \'%s\'", str);
479479

480480
errParam = vcardparameter_new_xlicerrortype(VCARD_XLICERRORTYPE_VALUEPARSEERROR);
481-
*error = vcardproperty_vanew_xlicerror(temp, errParam, 0);
481+
*error = vcardproperty_vanew_xlicerror(temp, errParam, (void *) 0);
482482
vcardparameter_free(errParam);
483483
}
484484

@@ -497,7 +497,7 @@ static vcardvalue *vcardvalue_new_from_string_with_error(vcardvalue_kind kind,
497497
snprintf(temp, TMP_BUF_SIZE, "Failed to parse value: \'%s\'", str);
498498

499499
errParam = vcardparameter_new_xlicerrortype(VCARD_XLICERRORTYPE_VALUEPARSEERROR);
500-
*error = vcardproperty_vanew_xlicerror(temp, errParam, 0);
500+
*error = vcardproperty_vanew_xlicerror(temp, errParam, (void *) 0);
501501
vcardparameter_free(errParam);
502502
}
503503

src/test/libicalvcard/vcard_test.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static vcardcomponent *test_comp_vanew(void)
146146
card = vcardcomponent_vanew(VCARD_VCARD_COMPONENT,
147147
vcardproperty_new_version(VCARD_VERSION_40),
148148
vcardproperty_new_kind(VCARD_KIND_INDIVIDUAL),
149-
0);
149+
(void *) 0);
150150

151151
if (card == NULL) {
152152
fprintf(stderr, "Failed to create vCard\n");
@@ -194,7 +194,7 @@ static void test_add_props(vcardcomponent *card)
194194
vcardproperty_vanew_note("Test vCard",
195195
vcardparameter_new_language("en"),
196196
vcardparameter_new_pid(sa),
197-
0);
197+
(void *) 0);
198198
vcardcomponent_add_property(card, prop);
199199
vcardproperty_set_group(prop, "group1");
200200

@@ -276,30 +276,30 @@ static void test_add_props(vcardcomponent *card)
276276
/* Create and add LOGO property */
277277
prop = vcardproperty_vanew_logo("https://example.com/logo.png",
278278
vcardparameter_new_mediatype("image/png"),
279-
0);
279+
(void *) 0);
280280
vcardcomponent_add_property(card, prop);
281281

282282
/* Create and add UID property */
283283
prop = vcardproperty_vanew_uid("foo-bar",
284284
vcardparameter_new_value(VCARD_VALUE_TEXT),
285-
0);
285+
(void *) 0);
286286
vcardcomponent_add_property(card, prop);
287287

288288
/* Create and add TEL property */
289289
prop = vcardproperty_vanew_tel("tel:+1-888-555-1212",
290290
vcardparameter_new_value(VCARD_VALUE_URI),
291-
0);
291+
(void *) 0);
292292
vcardcomponent_add_property(card, prop);
293293

294294
/* Create and add LANG properties */
295295
prop = vcardproperty_vanew_lang("fr",
296296
vcardparameter_new_pref(2),
297-
0);
297+
(void *) 0);
298298
vcardcomponent_add_property(card, prop);
299299

300300
prop = vcardproperty_vanew_lang("en",
301-
vcardparameter_new_pref(1),
302-
0);
301+
vcardparameter_new_pref(1),
302+
(void *) 0);
303303
vcardcomponent_add_property(card, prop);
304304

305305
vcardrestriction_check(card);

0 commit comments

Comments
 (0)