Skip to content

Commit

Permalink
WIP: more include file cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Winter committed Apr 30, 2015
1 parent a57d287 commit 68e3fcb
Show file tree
Hide file tree
Showing 37 changed files with 888 additions and 925 deletions.
3 changes: 3 additions & 0 deletions .krazy
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ SKIP /src/libicalvcal/vcaltmp\.
SKIP /src/libicalvcal/vcc\.
SKIP /src/libicalvcal/vobject\.

#Skip zoneinfo
SKIP /zoneinfo/

STYLE_LINEMAX 100
3 changes: 0 additions & 3 deletions ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ check_include_files(endian.h HAVE_ENDIAN_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/endian.h HAVE_SYS_ENDIAN_H)
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
Expand Down
9 changes: 0 additions & 9 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1

/* Define to 1 if you have the `strcasecmp' function. */
#cmakedefine HAVE_STRCASECMP 1

Expand Down Expand Up @@ -93,12 +90,6 @@
/* Define to 1 if you have the `_open' function. */
#cmakedefine HAVE__OPEN 1

/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1

/* Define to 1 if you have the <sys/endian.h> header file. */
#cmakedefine HAVE_SYS_ENDIAN_H 1

Expand Down
94 changes: 47 additions & 47 deletions src/libical/astime.h
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
/*
* Copyright (c) 1986-2000, Hiram Clawson
* All rights reserved.
* Copyright (c) 1986-2000, Hiram Clawson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
*
* Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither name of The Museum of Hiram nor the names of
* its contributors may be used to endorse or promote products
* derived from this software without specific prior
* written permission.
* Neither name of The Museum of Hiram nor the names of
* its contributors may be used to endorse or promote products
* derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
* @file astime.h
* @file astime.h
* @brief contains definitions of structures used for time calculations.
*/

#ifndef _astime_h_
#define _astime_h_
#ifndef ICAL_astime_h
#define ICAL_astime_h

typedef struct ut_instant {
double j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
long year; /**< year, valid range [-4,713, +2,147,483,647] */
int month; /**< [1-12] */
int day; /**< [1-31] */
int i_hour; /**< [0-23] */
int i_minute; /**< [0-59] */
int i_second; /**< [0-59] */
double d_hour; /**< [0.0-23.9999] includes minute and second */
double d_minute; /**< [0.0-59.9999] includes second */
double d_second; /**< [0.0-59.9999] */
int weekday; /**< [0-6] */
int day_of_year; /**< [1-366] */
double j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
long year; /**< year, valid range [-4,713, +2,147,483,647] */
int month; /**< [1-12] */
int day; /**< [1-31] */
int i_hour; /**< [0-23] */
int i_minute; /**< [0-59] */
int i_second; /**< [0-59] */
double d_hour; /**< [0.0-23.9999] includes minute and second */
double d_minute; /**< [0.0-59.9999] includes second */
double d_second; /**< [0.0-59.9999] */
int weekday; /**< [0-6] */
int day_of_year; /**< [1-366] */
} UTinstant, * UTinstantPtr;

/* Functions in caldate.c */
/* Functions in caldate.c */

long caldat( UTinstantPtr ); /** converts julian date to year,mo,da */
double juldat( UTinstantPtr ); /** returns julian day from year,mo,da */
long caldat( UTinstantPtr ); /** converts julian date to year,mo,da */
double juldat( UTinstantPtr ); /** returns julian day from year,mo,da */

#endif /* _astime_h_ */
#endif
19 changes: 19 additions & 0 deletions src/libical/icalcomponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@
#endif
#endif

struct icalcomponent_impl
{
char id[5];
icalcomponent_kind kind;
char* x_name;
pvl_list properties;
pvl_elem property_iterator;
pvl_list components;
pvl_elem component_iterator;
struct icalcomponent_impl *parent;

/** An array of icaltimezone structs. We use this so we can do fast
lookup of timezones using binary searches. timezones_sorted is
set to 0 whenever we add a timezone, so we remember to sort the
array before doing a binary search. */
icalarray* timezones;
int timezones_sorted;
};

/* icalproperty functions that only components get to use */
void icalproperty_set_parent(icalproperty* property,
icalcomponent* component);
Expand Down
18 changes: 0 additions & 18 deletions src/libical/icalcomponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@
#include "icalproperty.h"
#include "pvl.h"

struct icalcomponent_impl
{
char id[5];
icalcomponent_kind kind;
char* x_name;
pvl_list properties;
pvl_elem property_iterator;
pvl_list components;
pvl_elem component_iterator;
struct icalcomponent_impl *parent;

/** An array of icaltimezone structs. We use this so we can do fast
lookup of timezones using binary searches. timezones_sorted is
set to 0 whenever we add a timezone, so we remember to sort the
array before doing a binary search. */
icalarray* timezones;
int timezones_sorted;
};
typedef struct icalcomponent_impl icalcomponent;

#ifdef UNCLEAN
Expand Down
11 changes: 0 additions & 11 deletions src/libical/icalenums.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@
#include "icalenums.h"
#include "icalmemory.h"

#ifdef UNCLEAN
#include <stdio.h> /* For fprintf */
#include <stdio.h> /* For stderr */
#include <string.h> /* For strncmp */
#include <assert.h>

#if defined(_MSC_VER)
#define snprintf _snprintf
#endif
#endif

/*** @brief Allowed request status values
*/
static const struct {
Expand Down
2 changes: 1 addition & 1 deletion src/libical/icalerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
#include "icalerror.h"

#include <stdlib.h>

#ifdef HAVE_BACKTRACE
#include <execinfo.h>
#endif

#ifdef UNCLEAN
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for strcmp */
#if defined(_MSC_VER)
#define LIBICAL_EXPORT __declspec(dllexport)
Expand Down
Loading

0 comments on commit 68e3fcb

Please sign in to comment.