diff --git a/debian/changelog b/debian/changelog index b80f4ee..20e0447 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +libhdate (1.6-3) unstable; urgency=medium + + * Incorporate previous NMUs. + * Fix FTBFS with clang instead of GCC (Closes: #758453). + - Thanks Alexander Ovchinnikov. + * Thanking Baruch Even for his work on this package (Closes: #60005). + + -- Lior Kaplan Mon, 17 Aug 2015 17:18:17 +0200 + libhdate (1.6-2.2) unstable; urgency=medium * Non-maintainer upload with maintainer's permission diff --git a/debian/patches/clang.patch b/debian/patches/clang.patch new file mode 100644 index 0000000..c25c66e --- /dev/null +++ b/debian/patches/clang.patch @@ -0,0 +1,245 @@ +Description: Fix FTBFS with clang instead of GCC +Author: Alexander Ovchinnikov +Bug-Debian: http://bugs.debian.org/758453 + +--- a/examples/hcal/hcal.c ++++ b/examples/hcal/hcal.c +@@ -677,13 +677,6 @@ void print_header_month_line_stdout( con + } + + +-/************************************************** +-* print column headings for days of weeks +-**************************************************/ +-void print_header_dow_line_stdout( const int colorize ) +-{ +- int column; +- + void print_dow_column( int column ) + { + if (hdate_is_hebrew_locale()) +@@ -701,6 +694,13 @@ void print_header_dow_line_stdout( const + if (column != 7) printf (" "); + } + ++/************************************************** ++* print column headings for days of weeks ++**************************************************/ ++void print_header_dow_line_stdout( const int colorize ) ++{ ++ int column; ++ + if (colorize) colorize_element(ELEMENT_WEEKDAY_NAMES); + for (column = 1; column < 7; column++) print_dow_column(column); + if (colorize) colorize_element(ELEMENT_SHABBAT_NAME); +@@ -1149,27 +1149,15 @@ void print_week( int jd, const int month + + + +-/************************************************** +-* print month table +-*************************************************/ +-int print_calendar ( const int current_month, const int current_year, const option_list opt) +-{ +- hdate_struct h; +- int calendar_line; +- int max_calendar_lines = 4; +- int previous_month, next_month; +- int previous_year, next_year; +- int jd_current_month, jd_previous_month, jd_next_month; +- +- void how_many_calendar_lines( int month, int start_dow ) ++void how_many_calendar_lines( int month, int start_dow, int *max_calendar_lines ) + { + switch (month) + { + case 4: + case 6: + case 9: +- case 11: if (start_dow == 7) max_calendar_lines = 6; +- else if (max_calendar_lines == 4) max_calendar_lines = 5; ++ case 11: if (start_dow == 7) *max_calendar_lines = 6; ++ else if (*max_calendar_lines == 4) *max_calendar_lines = 5; + break; + case 1: + case 3: +@@ -1177,12 +1165,24 @@ int print_calendar ( const int current_m + case 7: + case 8: + case 10: +- case 12: if (start_dow > 5) max_calendar_lines = 6; +- else if (max_calendar_lines == 4) max_calendar_lines = 5; ++ case 12: if (start_dow > 5) *max_calendar_lines = 6; ++ else if (*max_calendar_lines == 4) *max_calendar_lines = 5; + break; + } + } + ++/************************************************** ++* print month table ++*************************************************/ ++int print_calendar ( const int current_month, const int current_year, const option_list opt) ++{ ++ hdate_struct h; ++ int calendar_line; ++ int max_calendar_lines = 4; ++ int previous_month, next_month; ++ int previous_year, next_year; ++ int jd_current_month, jd_previous_month, jd_next_month; ++ + /********************************************************* + * Preliminaries: + * - Find the first sunday(s) of each calendar +@@ -1190,7 +1190,7 @@ int print_calendar ( const int current_m + *********************************************************/ + hdate_set_gdate (&h, 1, current_month, current_year); + jd_current_month = h.hd_jd - h.hd_dw + 1; +- how_many_calendar_lines( h.gd_mon, h.hd_dw ); ++ how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); + + /********************************************************* + * three months, side-by-side +@@ -1212,7 +1212,7 @@ int print_calendar ( const int current_m + } + hdate_set_gdate (&h, 1, previous_month, previous_year); + jd_previous_month = h.hd_jd - h.hd_dw + 1; +- how_many_calendar_lines( h.gd_mon, h.hd_dw ); ++ how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); + + /********************************************************* + * next month +@@ -1229,7 +1229,7 @@ int print_calendar ( const int current_m + } + hdate_set_gdate (&h, 1, next_month, next_year); + jd_next_month = h.hd_jd - h.hd_dw + 1; +- how_many_calendar_lines( h.gd_mon, h.hd_dw ); ++ how_many_calendar_lines( h.gd_mon, h.hd_dw, &max_calendar_lines ); + } + + +--- a/examples/hcal/local_functions.c ++++ b/examples/hcal/local_functions.c +@@ -646,62 +646,50 @@ file. Attempting to create a config file + #include + #include // for mkdir, + +-/************************************************************ +-* Open config file, or create one +-* - returns filepointer or NULL +-* - if file does not exist, attempt to create it +-************************************************************/ +-FILE* get_config_file( const char* config_dir_name, +- const char* config_file_name, +- const char* default_config_file_text ) +-{ +- size_t path_len; +- +- char* config_home_path_name = ""; +- char* config_sub_path_name = ""; +- +- char* config_dir_path; +- char* config_file_path; +- +- FILE* config_file; + + /************************************************************ + * sub-function to get_config_file: create_config_file + ************************************************************/ +- void create_config_file() ++ void create_config_file(FILE** config_file, char* config_file_path, ++ const char* default_config_file_text, const char* config_file_name) + { +- config_file = fopen(config_file_path, "a"); +- if (config_file == NULL) ++ *config_file = fopen(config_file_path, "a"); ++ if (*config_file == NULL) + { + error(0, errno, "%s: %s", N_("failure attempting to create config file"), config_file_path); + return; + } +- fprintf(config_file, "%s", default_config_file_text); ++ fprintf(*config_file, "%s", default_config_file_text); + error(0,0,"%s: %s",N_("config file created"), config_file_path); +- if (fclose(config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); ++ if (fclose(*config_file) != 0) error(0,errno,"%s %s",N_("failure closing"),config_file_name); + } + + /************************************************************ + * sub-function to get_config_file: open_config_file + ************************************************************/ +- int open_config_file() ++ int open_config_file(FILE** config_file, char* config_file_path, ++ size_t *path_len, const char* config_home_path_name, ++ const char* config_sub_path_name, const char* config_dir_name, ++ const char* default_config_file_text, const char* config_file_name) + { +- config_file = fopen(config_file_path, "r"); +- if (config_file == NULL) ++ char* config_dir_path; ++ ++ *config_file = fopen(config_file_path, "r"); ++ if (*config_file == NULL) + { + if (errno != ENOENT) return FALSE; + // maybe replace all this with a single line asprintf() +- path_len = strlen(config_home_path_name) ++ *path_len = strlen(config_home_path_name) + + strlen(config_sub_path_name) + + strlen(config_dir_name) +1; +- if (path_len < 1) return FALSE; +- config_dir_path = malloc(path_len); ++ if (*path_len < 1) return FALSE; ++ config_dir_path = malloc(*path_len); + if (config_dir_path == NULL) + { + error(0,errno,"%s",N_("memory allocation failure")); + return FALSE; + } +- snprintf(config_dir_path, path_len, "%s%s%s", ++ snprintf(config_dir_path, *path_len, "%s%s%s", + config_home_path_name, config_sub_path_name, + config_dir_name); + +@@ -712,13 +700,30 @@ FILE* get_config_file( const char* confi + return FALSE; + } + greetings_to_version_16(); +- create_config_file(); ++ create_config_file(config_file, config_file_path, default_config_file_text, config_file_name); + free(config_dir_path); + return FALSE; + } + return TRUE; + } + ++/************************************************************ ++* Open config file, or create one ++* - returns filepointer or NULL ++* - if file does not exist, attempt to create it ++************************************************************/ ++FILE* get_config_file( const char* config_dir_name, ++ const char* config_file_name, ++ const char* default_config_file_text ) ++{ ++ size_t path_len; ++ ++ char* config_home_path_name = ""; ++ char* config_sub_path_name = ""; ++ ++ char* config_file_path; ++ ++ FILE* config_file; + + /************************************************************ + * main part of function get_config_file +@@ -750,7 +755,9 @@ FILE* get_config_file( const char* confi + config_home_path_name, config_sub_path_name, + config_dir_name, config_file_name); + +- if (open_config_file() == TRUE) ++ if (open_config_file(&config_file, config_file_path, &path_len, config_home_path_name, ++ config_sub_path_name, config_dir_name, ++ default_config_file_text, config_file_name) == TRUE) + { + free(config_file_path); + return config_file; diff --git a/debian/patches/series b/debian/patches/series index 8502cf2..8f0544c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,4 @@ size_t.patch nested_extern.patch missing_format.patch +clang.patch