diff options
-rw-r--r-- | .krazy | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 14 | ||||
-rw-r--r-- | ReleaseNotes.txt | 2 | ||||
-rw-r--r-- | appveyor.yml | 38 | ||||
-rwxr-xr-x | scripts/buildtests.sh | 2 | ||||
-rw-r--r-- | scripts/set_compiler_env.bat | 16 | ||||
-rw-r--r-- | src/libical-glib/api/i-cal-component.xml | 77 | ||||
-rw-r--r-- | src/libical-glib/i-cal-object.c.in | 89 | ||||
-rw-r--r-- | src/libical-glib/i-cal-object.h.in | 4 | ||||
-rwxr-xr-x | src/test/libical-glib/component.py | 4 | ||||
-rw-r--r-- | src/test/regression.c | 26 |
12 files changed, 220 insertions, 62 deletions
@@ -29,6 +29,7 @@ SKIP /src/libicalvcal/vobject\. #Skip contributed files SKIP /src/libical/astime\.h SKIP /src/libical/caldate\.c +SKIP /cmake/Kitware/ SKIP /cmake/modules/GObjectIntrospectionMacros\.cmake|/cmake/modules/FindGObjectIntrospection\.cmake SKIP /doc/Doxyfile\.cmake SKIP /cmake/Toolchain-iOS.cmake|/cmake/Toolchain-QNX65.cmake|/cmake/Toolchain-QNX66.cmake|/cmake/Toolchain-android.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3df5d7..ae1f08f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,8 +101,11 @@ endif() if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() +if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) #don't warn about ICU_ROOT envvar +endif() -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") #Include CMake capabilities include(LibIcalMacrosInternal) @@ -241,9 +244,9 @@ if(ICU_FOUND) get_filename_component(ICU_EXEC ${ICU_MAKECONV_EXECUTABLE} DIRECTORY) else() message(FATAL_ERROR - "Unable find locate the ICU runtime path. Is your ICU installation broken?") + "Unable to locate the ICU runtime path. Is your ICU installation broken?") endif() - set(ICU_BINARY_DIR ${ICU_EXEC} CACHE DOC STRING "Runtime binaries directory for the ICU library") + set(ICU_BINARY_DIR ${ICU_EXEC} CACHE STRING DOC "Runtime binaries directory for the ICU library") endif() # compile in Berkeley DB support diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 545877ae..08b74f4e 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -64,10 +64,16 @@ endif() if(NOT DEFINED CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES "") endif() -set(_SAVE_RQL ${CMAKE_REQUIRED_LIBRARIES}) -set(CMAKE_REQUIRED_LIBRARIES kernel32.lib) -check_function_exists(GetNumberFormat HAVE_GETNUMBERFORMAT) #Windows <windows.h> -set(CMAKE_REQUIRED_LIBRARIES ${_SAVE_RQL}) +#GetNumberFormat is not implemented on wine correctly +#(see https://forum.winehq.org/viewtopic.php?t=27809) which results in +#error when building. That means if linux user has installed wine, +#the build of libical will fail. +if(WIN32) + set(_SAVE_RQL ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES kernel32.lib) + check_function_exists(GetNumberFormat HAVE_GETNUMBERFORMAT) #Windows <windows.h> + set(CMAKE_REQUIRED_LIBRARIES ${_SAVE_RQL}) +endif() include(CheckTypeSize) check_type_size(intptr_t SIZEOF_INTPTR_T) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 3c56e80c..5cb02672 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -42,7 +42,7 @@ Version 3.1.0 (NOT RELEASED YET): Version 3.0.12 (UNRELEASED): ---------------------------- - * + * Improved FindICU (copied from official CMake. see files in cmake/Kitware) Version 3.0.11 (09 October 2021): --------------------------------- diff --git a/appveyor.yml b/appveyor.yml index d32c2bc2..175712c1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,10 @@ skip_tags: false # Build worker image image: - - Visual Studio 2013 + #- Visual Studio 2013 #disable since Ninja is not available + - Visual Studio 2019 + - macos + - Ubuntu # scripts that are called at very beginning, before repo cloning init: @@ -31,21 +34,29 @@ init: # build platform, i.e. x86, x64, Any CPU. This setting is optional. platform: -# - x86 uses 32bit time_t + - x86 - x64 # build Configuration, i.e. Debug, Release, etc. configuration: - - 2013 -# - 2012 -# - MinGW + - Release + - Debug + +install: + - sh: if [ "`uname -s`" = "Darwin" ]; then export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig; export XML_CATALOG_FILES=/usr/local/etc/xml/catalog; brew install pkg-config ninja gtk-doc glib libxml2 icu4c berkeley-db gobject-introspection vala; else sudo apt-get -y install gtk-doc-tools xml-core libdb-dev gobject-introspection libgirepository1.0-dev valac; fi + +before_build: + - cmd: call scripts\set_compiler_env.bat build_script: - - call scripts\set_compiler_env.bat - mkdir build - cd build - - if "%configuration%" EQU "MinGW" ( cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DICAL_GLIB=False .. ) else ( cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DICAL_GLIB=False .. ) - - nmake + - cmd: cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DLIBICAL_BUILD_TESTING=True -DENABLE_GTK_DOC=True -DICAL_GLIB=False .. + - sh: if [ "`uname -s`" = "Darwin" ]; then BUILD_EXTRAS="False"; else BUILD_EXTRAS="True"; fi; cmake -G Ninja -DCMAKE_BUILD_TYPE=$CONFIGURATION -DLIBICAL_BUILD_TESTING=True -DENABLE_GTK_DOC=True -DICAL_GLIB=True -DGOBJECT_INTROSPECTION=$BUILD_EXTRAS -DICAL_GLIB_VAPI=$BUILD_EXTRAS .. + - cmake --build . + - cmd: cmake --build . --target install + - sh: sudo cmake --build . --target install + - ctest --test-dir . # to disable automatic builds #build: off @@ -54,12 +65,8 @@ build_script: # tests configuration # #---------------------------------# -test_script: - - nmake test - # to disable automatic tests -#test: off - +test: off #---------------------------------# # deployment configuration # @@ -74,5 +81,6 @@ notifications: # Email - provider: Email to: - - allen.winter@kdab.com - on_build_status_changed: true + - winter@kde.org + on_build_success: false + on_build_failure: true diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh index bacfae78..7e8d2439 100755 --- a/scripts/buildtests.sh +++ b/scripts/buildtests.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #Exit if any undefined variable is used. set -u diff --git a/scripts/set_compiler_env.bat b/scripts/set_compiler_env.bat index 6bbe2a89..47d7c50f 100644 --- a/scripts/set_compiler_env.bat +++ b/scripts/set_compiler_env.bat @@ -3,35 +3,35 @@ :: Now we declare a scope Setlocal EnableDelayedExpansion EnableExtensions -if not defined Configuration set Configuration=2015 +if not defined APPVEYOR_BUILD_WORKER_IMAGE set APPVEYOR_BUILD_WORKER_IMAGE="Visual Studio 2019" -if "%Configuration%"=="MinGW" ( goto :mingw ) +if "%USE_MINGW%"=="MinGW" ( goto :mingw ) set arch=x86 if "%platform%" EQU "x64" ( set arch=x86_amd64 ) -if "%Configuration%"=="2019" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" ) -if "%Configuration%"=="2015" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ) -if "%Configuration%"=="2013" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" ) -if "%Configuration%"=="2012" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2012" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" ) -if "%Configuration%"=="2010" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2010" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" ) -if "%Configuration%"=="2008" ( +if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2008" ( set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" ) diff --git a/src/libical-glib/api/i-cal-component.xml b/src/libical-glib/api/i-cal-component.xml index 29d13e53..bb262dde 100644 --- a/src/libical-glib/api/i-cal-component.xml +++ b/src/libical-glib/api/i-cal-component.xml @@ -182,32 +182,89 @@ <returns type="ICalComponent *" annotation="transfer full, nullable" translator_argus="(GObject *)component" comment="The next #ICalComponent."/> <comment xml:space="preserve">Gets the next #ICalComponent with specific kind in #ICalComponent.</comment> </method> - <method name="i_cal_component_begin_component" corresponds="icalcomponent_begin_component" since="1.0"> + <method name="i_cal_component_begin_component" corresponds="CUSTOM" since="1.0"> <parameter type="ICalComponent *" name="component" comment="A #ICalComponent"/> <parameter type="ICalComponentKind" name="kind" comment="A #ICalComponentKind"/> <returns type="ICalCompIter *" annotation="transfer full" comment="A #ICalCompIter"/> - <comment xml:space="preserve">Gets the #ICalCompIter pointing to the first child #ICalComponent. Use #ICalCompIter when you need remove the child component from the parent. For traversing, i_cal_object_set_owner needs to be called after this API. See component.py in tests for details.</comment> + <comment xml:space="preserve">Gets the #ICalCompIter pointing to the first child #ICalComponent.</comment> + <custom> ICalCompIter *iter; + + g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL); + + iter = i_cal_comp_iter_new_full(icalcomponent_begin_component((icalcomponent *)i_cal_object_get_native(I_CAL_OBJECT (component)), (icalcomponent_kind) (kind))); + if (iter) { + i_cal_object_set_owner(I_CAL_OBJECT(iter), G_OBJECT(component)); + i_cal_object_set_always_destroy(I_CAL_OBJECT(iter), TRUE); + } + + return iter;</custom> </method> - <method name="i_cal_component_end_component" corresponds="icalcomponent_end_component" since="1.0"> + <method name="i_cal_component_end_component" corresponds="CUSTOM" since="1.0"> <parameter type="ICalComponent *" name="component" comment="A #ICalComponent"/> <parameter type="ICalComponentKind" name="kind" comment="A #ICalComponentKind"/> <returns type="ICalCompIter *" annotation="transfer full" comment="A #ICalCompIter"/> - <comment xml:space="preserve">Gets the #ICalCompIter pointing to the end child #ICalComponent. Use #ICalCompIter when you need remove the child component from the parent. For traversing, i_cal_object_set_owner needs to be called after this API. See component.py in tests for details.</comment> + <comment xml:space="preserve">Gets the #ICalCompIter pointing to the end child #ICalComponent.</comment> + <custom> ICalCompIter *iter; + g_return_val_if_fail (I_CAL_IS_COMPONENT (component), NULL); + + iter = i_cal_comp_iter_new_full(icalcomponent_end_component((icalcomponent *)i_cal_object_get_native(I_CAL_OBJECT (component)), (icalcomponent_kind) (kind))); + if (iter) { + i_cal_object_set_owner(I_CAL_OBJECT(iter), G_OBJECT(component)); + i_cal_object_set_always_destroy(I_CAL_OBJECT(iter), TRUE); + } + + return iter;</custom> </method> - <method name="i_cal_comp_iter_next" corresponds="icalcompiter_next" since="1.0"> + <method name="i_cal_comp_iter_next" corresponds="CUSTOM" since="1.0"> <parameter type="ICalCompIter *" name="i" native_op="POINTER" comment="A #ICalCompIter"/> <returns type="ICalComponent *" annotation="transfer full" comment="A #ICalCompIter"/> - <comment xml:space="preserve">Gets the next #ICalComponent pointed by #ICalCompIter. Use #ICalCompIter when you need remove the child component from the parent. For traversing, i_cal_object_set_owner needs to be called after this API. See component.py in tests for details.</comment> + <comment xml:space="preserve">Gets the next #ICalComponent pointed by #ICalCompIter.</comment> + <custom> ICalComponent *comp; + + g_return_val_if_fail (I_CAL_IS_COMP_ITER (i), NULL); + + comp = i_cal_component_new_full(icalcompiter_next((struct icalcompiter *)i_cal_object_get_native(I_CAL_OBJECT (i))), NULL); + if (comp) { + GObject *owner = i_cal_object_ref_owner(I_CAL_OBJECT(i)); + i_cal_object_set_owner(I_CAL_OBJECT(comp), owner); + g_clear_object(&owner); + } + + return comp;</custom> </method> - <method name="i_cal_comp_iter_prior" corresponds="icalcompiter_prior" since="1.0"> + <method name="i_cal_comp_iter_prior" corresponds="CUSTOM" since="1.0"> <parameter type="ICalCompIter *" name="i" native_op="POINTER" comment="A #ICalCompIter"/> <returns type="ICalComponent *" annotation="transfer full" comment="A #ICalCompIter"/> - <comment xml:space="preserve">Gets the prior #ICalComponent pointed by #ICalCompIter. Use #ICalCompIter when you need remove the child component from the parent. For traversing, i_cal_object_set_owner needs to be called after this API. See component.py in tests for details.</comment> + <comment xml:space="preserve">Gets the prior #ICalComponent pointed by #ICalCompIter.</comment> + <custom> ICalComponent *comp; + + g_return_val_if_fail (I_CAL_IS_COMP_ITER (i), NULL); + + comp = i_cal_component_new_full(icalcompiter_prior((struct icalcompiter *)i_cal_object_get_native(I_CAL_OBJECT (i))), NULL); + if (comp) { + GObject *owner = i_cal_object_ref_owner(I_CAL_OBJECT(i)); + i_cal_object_set_owner(I_CAL_OBJECT(comp), owner); + g_clear_object(&owner); + } + + return comp;</custom> </method> - <method name="i_cal_comp_iter_deref" corresponds="icalcompiter_deref" since="1.0"> + <method name="i_cal_comp_iter_deref" corresponds="CUSTOM" since="1.0"> <parameter type="ICalCompIter *" name="i" native_op="POINTER" comment="A #ICalCompIter"/> <returns type="ICalComponent *" annotation="transfer full" comment="A #ICalComponent"/> - <comment xml:space="preserve">Gets the current #ICalComponent pointed by #ICalCompIter. Use #ICalCompIter when you need remove the child component from the parent. For traversing, i_cal_object_set_owner needs to be called after this API. See component.py in tests for details.</comment> + <comment xml:space="preserve">Gets the current #ICalComponent pointed by #ICalCompIter.</comment> + <custom> ICalComponent *comp; + + g_return_val_if_fail (I_CAL_IS_COMP_ITER (i), NULL); + + comp = i_cal_component_new_full(icalcompiter_deref((struct icalcompiter *)i_cal_object_get_native(I_CAL_OBJECT (i))), NULL); + if (comp) { + GObject *owner = i_cal_object_ref_owner(I_CAL_OBJECT(i)); + i_cal_object_set_owner(I_CAL_OBJECT(comp), owner); + g_clear_object(&owner); + } + + return comp;</custom> </method> <method name="i_cal_component_check_restrictions" corresponds="icalcomponent_check_restrictions" kind="other" since="1.0"> <parameter type="ICalComponent *" name="comp" comment="The #ICalComponent to be checked"/> diff --git a/src/libical-glib/i-cal-object.c.in b/src/libical-glib/i-cal-object.c.in index 4b2fa34e..a06d29d4 100644 --- a/src/libical-glib/i-cal-object.c.in +++ b/src/libical-glib/i-cal-object.c.in @@ -107,6 +107,7 @@ typedef struct gpointer native; GDestroyNotify native_destroy_func; gboolean is_global_memory; + gboolean always_destroy; GObject *owner; GSList *dependers; /* referenced GObject-s */ } ICalObjectPrivate; @@ -122,6 +123,7 @@ enum PROP_NATIVE, PROP_NATIVE_DESTROY_FUNC, PROP_IS_GLOBAL_MEMORY, + PROP_ALWAYS_DESTROY, PROP_OWNER }; @@ -149,6 +151,10 @@ static void i_cal_object_set_property(GObject *object, guint property_id, priv->is_global_memory = g_value_get_boolean(value); return; + case PROP_ALWAYS_DESTROY: + i_cal_object_set_always_destroy(iobject, g_value_get_boolean(value)); + return; + case PROP_OWNER: i_cal_object_set_owner(iobject, g_value_get_object(value)); return; @@ -177,6 +183,10 @@ static void i_cal_object_get_property(GObject *object, guint property_id, g_value_set_boolean(value, i_cal_object_get_is_global_memory(iobject)); return; + case PROP_ALWAYS_DESTROY: + g_value_set_boolean(value, i_cal_object_get_always_destroy(iobject)); + return; + case PROP_OWNER: g_value_take_object(value, i_cal_object_ref_owner(iobject)); return; @@ -190,9 +200,10 @@ static void i_cal_object_finalize(GObject *object) ICalObject *iobject = I_CAL_OBJECT(object); ICalObjectPrivate *priv = i_cal_object_get_instance_private(iobject); - if (!priv->owner && !priv->is_global_memory && - priv->native && priv->native_destroy_func) { - g_clear_pointer(&priv->native, priv->native_destroy_func); + if ((iobject->priv->always_destroy || !iobject->priv->owner) && + !iobject->priv->is_global_memory && + iobject->priv->native && iobject->priv->native_destroy_func) { + iobject->priv->native_destroy_func(iobject->priv->native); } g_clear_object(&priv->owner); @@ -264,6 +275,25 @@ static void i_cal_object_class_init(ICalObjectClass * class) G_PARAM_STATIC_STRINGS)); /** + * ICalObject:always-destroy: + * + * Whether free the native libical structure on #ICalObject's finalize even + * if the object has set an owner. + * + * Since: 3.0.11 + **/ + g_object_class_install_property( + object_class, + PROP_ALWAYS_DESTROY, + g_param_spec_boolean( + "always-destroy", + "Always-Destroy", + "Whether the native libical structure is freed even when the owner is set", + FALSE, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** * ICalObject:owner: * * Owner of the native libical structure. If set, then it is @@ -663,3 +693,56 @@ void i_cal_object_remove_depender(ICalObject *iobject, GObject *depender) UNLOCK_PROPS(priv); } + +/** + * i_cal_object_set_always_destroy: + * @iobject: an #ICalObject + * @value: value to set + * + * Sets the @ICalObject::always-destroy property value. When %TRUE, the native + * libical structure is always freed, even when an owner of the @iobject is set. + * + * Since: 3.0.11 + **/ +void i_cal_object_set_always_destroy(ICalObject *iobject, gboolean value) +{ + gboolean changed; + + g_return_if_fail(I_CAL_IS_OBJECT(iobject)); + + LOCK_PROPS(iobject); + + changed = (value ? 1 : 0) != (iobject->priv->always_destroy ? 1 : 0); + if (changed) + iobject->priv->always_destroy = value; + + UNLOCK_PROPS(iobject); + + if (changed) + g_object_notify(G_OBJECT(iobject), "always-destroy"); +} + +/** + * i_cal_object_get_always_destroy: + * @iobject: an #ICalObject + * + * Obtain the @ICalObject::always-destroy property value. + * + * Returns: Whether the native libical structure is freed even when an owner is set. + * + * Since: 3.0.11 + **/ +gboolean i_cal_object_get_always_destroy(ICalObject *iobject) +{ + gboolean value; + + g_return_val_if_fail(I_CAL_IS_OBJECT(iobject), FALSE); + + LOCK_PROPS(iobject); + + value = iobject->priv->always_destroy; + + UNLOCK_PROPS(iobject); + + return value; +} diff --git a/src/libical-glib/i-cal-object.h.in b/src/libical-glib/i-cal-object.h.in index 799e3112..a39ebddd 100644 --- a/src/libical-glib/i-cal-object.h.in +++ b/src/libical-glib/i-cal-object.h.in @@ -77,6 +77,10 @@ LIBICAL_ICAL_EXPORT void i_cal_object_add_depender(ICalObject *iobject, GObject LIBICAL_ICAL_EXPORT void i_cal_object_remove_depender(ICalObject *iobject, GObject *depender); +LIBICAL_ICAL_EXPORT void i_cal_object_set_always_destroy(ICalObject *iobject, gboolean value); + +LIBICAL_ICAL_EXPORT gboolean i_cal_object_get_always_destroy(ICalObject *iobject); + LIBICAL_ICAL_EXPORT void i_cal_object_free_global_objects(void); G_END_DECLS diff --git a/src/test/libical-glib/component.py b/src/test/libical-glib/component.py index cbdb097e..cc6cfa6a 100755 --- a/src/test/libical-glib/component.py +++ b/src/test/libical-glib/component.py @@ -183,25 +183,21 @@ def main(): #Traverse with external API. iter = parent.begin_component(ICalGLib.ComponentKind.VEVENT_COMPONENT); child_component = iter.deref(); - child_component.set_owner(parent); for i in range(0, count): prefix = "test" index = i+2; assert(child_component.get_summary() == prefix + str(index)); if (i != count-1): child_component = iter.next(); - child_component.set_owner(parent); iter = parent.end_component(ICalGLib.ComponentKind.VEVENT_COMPONENT); child_component = iter.prior(); - child_component.set_owner(parent); for i in range(0, count): prefix = "test" index = count + 1 - i; assert(child_component.get_summary() == prefix + str(index)); if (i != count - 1): child_component = iter.prior(); - child_component.set_owner(parent); #Traverse and remove with external API. iter = parent.begin_component(ICalGLib.ComponentKind.VEVENT_COMPONENT); diff --git a/src/test/regression.c b/src/test/regression.c index e0de9e9e..656ca30b 100644 --- a/src/test/regression.c +++ b/src/test/regression.c @@ -4623,7 +4623,7 @@ void test_timezone_from_builtin(void) icaltimezone *zone; struct icaltimetype dtstart, dtend, due; char *strcomp, *tzidprefix, *prevslash = NULL, *prevprevslash = NULL, *p; - int len; + size_t len; zone = icaltimezone_get_builtin_timezone("America/New_York"); tzidprefix = strdup(icaltimezone_get_tzid (zone)); @@ -4879,7 +4879,7 @@ static void test_builtin_compat_tzid (void) icaltimezone_free_builtin_timezones(); } -static void test_vcc_vcard_parse (void) +static void test_vcc_vcard_parse(void) { /* Two VCARD-s, because some arches can parse the first and some the second. */ const char *vcard1 = @@ -4911,40 +4911,40 @@ static void test_vcc_vcard_parse (void) "END:VCALENDAR\r\n"; VObject *vcal; - vcal = Parse_MIME(vcard1, strlen(vcard1)); + vcal = Parse_MIME(vcard1, (unsigned long)strlen(vcard1)); if(vcal) { icalcomponent *icalcomp; - icalcomp = icalvcal_convert (vcal); + icalcomp = icalvcal_convert(vcal); ok("vCard1 is not iCalendar", (icalcomp == NULL)); if(icalcomp) - icalcomponent_free (icalcomp); + icalcomponent_free(icalcomp); cleanVObject (vcal); } else { ok("vCard1 cannot be parsed", (vcal == NULL)); } - vcal = Parse_MIME(vcard2, strlen(vcard2)); + vcal = Parse_MIME(vcard2, (unsigned long)strlen(vcard2)); if(vcal) { icalcomponent *icalcomp; - icalcomp = icalvcal_convert (vcal); + icalcomp = icalvcal_convert(vcal); ok("vCard2 is not iCalendar", (icalcomp == NULL)); if(icalcomp) - icalcomponent_free (icalcomp); + icalcomponent_free(icalcomp); - cleanVObject (vcal); + cleanVObject(vcal); } else { ok("vCard2 cannot be parsed", (vcal == NULL)); } - vcal = Parse_MIME(vcalendar, strlen(vcalendar)); + vcal = Parse_MIME(vcalendar, (unsigned long)strlen(vcalendar)); ok("vCalendar can be parsed", (vcal != NULL)); if(vcal) { icalcomponent *icalcomp; - icalcomp = icalvcal_convert (vcal); + icalcomp = icalvcal_convert(vcal); ok("vCalendar can be converted", (icalcomp != NULL)); if(icalcomp) { icalcomponent *child; @@ -4956,10 +4956,10 @@ static void test_vcc_vcard_parse (void) ok("vCalendar child is VEVENT", (icalcomponent_isa(child) == ICAL_VEVENT_COMPONENT)); ok("vCalendar child UID matches", (strcmp(icalcomponent_get_uid(child), "123") == 0)); ok("vCalendar child SUMMARY matches", (strcmp(icalcomponent_get_summary(child), "Summary") == 0)); - icalcomponent_free (icalcomp); + icalcomponent_free(icalcomp); } - cleanVObject (vcal); + cleanVObject(vcal); } } |