diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-10-11 14:19:20 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-10-13 13:01:56 +0100 |
commit | 4e6461c5bac0cb186cd213766669adcbe7dec3b0 (patch) | |
tree | 5f60c89cd84f3aabb778c7aee0852b9a19738a63 | |
parent | eb451639db5529b4d63dc1877f9c62baf490163b (diff) | |
download | libgweather-4e6461c5bac0cb186cd213766669adcbe7dec3b0.tar.gz |
Clean up source files preamble
- Use SPDX tags for copyright and license
- Include "config.h" unconditionally, we're not using Autotools
- Include the local headers first
-rw-r--r-- | libgweather/gweather-enum-types.c.tmpl | 7 | ||||
-rw-r--r-- | libgweather/gweather-location-entry.c | 33 | ||||
-rw-r--r-- | libgweather/gweather-location.c | 30 | ||||
-rw-r--r-- | libgweather/gweather-private.c | 22 | ||||
-rw-r--r-- | libgweather/gweather-timezone-menu.c | 25 | ||||
-rw-r--r-- | libgweather/gweather-timezone.c | 27 | ||||
-rw-r--r-- | libgweather/gweather-weather.c | 31 | ||||
-rw-r--r-- | libgweather/gweather.c | 30 | ||||
-rw-r--r-- | libgweather/test_metar.c | 16 | ||||
-rw-r--r-- | libgweather/test_sun_moon.c | 11 | ||||
-rw-r--r-- | libgweather/weather-iwin.c | 24 | ||||
-rw-r--r-- | libgweather/weather-metar.c | 24 | ||||
-rw-r--r-- | libgweather/weather-metno.c | 27 | ||||
-rw-r--r-- | libgweather/weather-moon.c | 26 | ||||
-rw-r--r-- | libgweather/weather-owm.c | 24 | ||||
-rw-r--r-- | libgweather/weather-sun.c | 24 |
16 files changed, 98 insertions, 283 deletions
diff --git a/libgweather/gweather-enum-types.c.tmpl b/libgweather/gweather-enum-types.c.tmpl index 1138697..3e96a16 100644 --- a/libgweather/gweather-enum-types.c.tmpl +++ b/libgweather/gweather-enum-types.c.tmpl @@ -1,12 +1,11 @@ /*** BEGIN file-header ***/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "gweather-enum-types.h" -#include "gweather-location.h" #include "gweather-enums.h" +#include "gweather-location.h" +#include "gweather-timezone.h" #include "gweather-weather.h" /*** END file-header ***/ diff --git a/libgweather/gweather-location-entry.c b/libgweather/gweather-location-entry.c index 70eeaa1..f41208e 100644 --- a/libgweather/gweather-location-entry.c +++ b/libgweather/gweather-location-entry.c @@ -1,34 +1,19 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* location-entry.c - Location-selecting text entry +/* gweather-location-entry.c - Location-selecting text entry * - * Copyright 2008, Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2008, Red Hat, Inc. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <geocode-glib/geocode-glib.h> -#include <gio/gio.h> +#include "config.h" #include "gweather-location-entry.h" + #include "gweather-private.h" +#include <string.h> +#include <gio/gio.h> +#include <geocode-glib/geocode-glib.h> + /** * SECTION:gweatherlocationentry * @Title: GWeatherLocationEntry diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c index b4df218..1f06b41 100644 --- a/libgweather/gweather-location.c +++ b/libgweather/gweather-location.c @@ -1,26 +1,15 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* gweather-location.c - Location-handling code * - * Copyright 2008, Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2008, Red Hat, Inc. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-location.h" + +#include "gweather-private.h" +#include "gweather-timezone.h" #include <string.h> #include <math.h> @@ -29,9 +18,6 @@ #include <libxml/xmlreader.h> #include <geocode-glib/geocode-glib.h> -#include "gweather-timezone.h" -#include "gweather-private.h" - /* This is the precision of coordinates in the database */ #define EPSILON 0.000001 diff --git a/libgweather/gweather-private.c b/libgweather/gweather-private.c index 0a4e0cd..8b39401 100644 --- a/libgweather/gweather-private.c +++ b/libgweather/gweather-private.c @@ -1,24 +1,10 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* weather.c - Overall weather server functions +/* gweather-private.c - Overall weather server functions * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" #include "gweather-private.h" diff --git a/libgweather/gweather-timezone-menu.c b/libgweather/gweather-timezone-menu.c index c33e6d2..01a2851 100644 --- a/libgweather/gweather-timezone-menu.c +++ b/libgweather/gweather-timezone-menu.c @@ -1,28 +1,13 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* timezone-menu.c - Timezone-selecting menu +/* gweather-timezone-menu.c - Timezone-selecting menu * - * Copyright 2008, Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2008, Red Hat, Inc. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" #include "gweather-timezone-menu.h" + #include "gweather-private.h" #include <string.h> diff --git a/libgweather/gweather-timezone.c b/libgweather/gweather-timezone.c index aa86756..27c4321 100644 --- a/libgweather/gweather-timezone.c +++ b/libgweather/gweather-timezone.c @@ -1,32 +1,17 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* gweather-timezone.c - Timezone handling * - * Copyright 2008, Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2008, Red Hat, Inc. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> +#include "config.h" #include "gweather-timezone.h" + #include "gweather-private.h" +#include <string.h> + /** * SECTION:gweathertimezone * @Title: GWeatherTimezone diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c index 17711ac..4a33def 100644 --- a/libgweather/gweather-weather.c +++ b/libgweather/gweather-weather.c @@ -1,24 +1,15 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* weather.c - Overall weather server functions +/* gweather-weather.c - Overall weather server functions * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-weather.h" + +#include "gweather-private.h" +#include "gweather-enum-types.h" #include <stdio.h> #include <stdlib.h> @@ -33,10 +24,6 @@ #include <gio/gio.h> -#include "gweather-weather.h" -#include "gweather-private.h" -#include "gweather-enum-types.h" - #define MOON_PHASES 36 diff --git a/libgweather/gweather.c b/libgweather/gweather.c index 7f410b3..62a35a5 100644 --- a/libgweather/gweather.c +++ b/libgweather/gweather.c @@ -1,29 +1,15 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* weather.c - Overall weather server functions +/* gweather.c - Overall weather server functions * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" #include "gweather.h" /* - There is no code here: the purpose of this header is so that - gnome-builder knows how to pick up the include flags to parse - gweather.h properly. -*/ + * There is no code here: the purpose of this header is so that + * gnome-builder knows how to pick up the include flags to parse + * gweather.h properly. + */ diff --git a/libgweather/test_metar.c b/libgweather/test_metar.c index c36c86b..72a3e13 100644 --- a/libgweather/test_metar.c +++ b/libgweather/test_metar.c @@ -1,16 +1,16 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * Simple program to reproduce METAR parsing results from command line +/* test_metar.c: Simple program to reproduce METAR parsing results from command line + * + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" -#include <glib.h> #include <string.h> #include <stdio.h> -#include "gweather-private.h" +#include <glib.h> #ifndef BUFLEN #define BUFLEN 4096 diff --git a/libgweather/test_sun_moon.c b/libgweather/test_sun_moon.c index 87401bf..6cdfb50 100644 --- a/libgweather/test_sun_moon.c +++ b/libgweather/test_sun_moon.c @@ -1,8 +1,11 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* test_sun_moon.c: Test for Sun and Moon computations + * + * SPDX-FileCopyrightText: 2009 Frank Solensky + * SPDX-FileCopyrightText: 2011, 2012, 2015 Giovanni Campagna + * SPDX-License-Identifier: GPL-2.0-or-later + */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" #include <glib.h> #include <string.h> diff --git a/libgweather/weather-iwin.c b/libgweather/weather-iwin.c index 6b48997..d7de12c 100644 --- a/libgweather/weather-iwin.c +++ b/libgweather/weather-iwin.c @@ -1,24 +1,12 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* weather-iwin.c - US National Weather Service IWIN forecast source * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #include <ctype.h> #include <stdlib.h> @@ -26,8 +14,6 @@ #include <libxml/parser.h> -#include "gweather-private.h" - static gboolean hasAttr (xmlNode *node, const char *attr_name, const char *attr_value) { diff --git a/libgweather/weather-metar.c b/libgweather/weather-metar.c index ec88a87..7f3bf46 100644 --- a/libgweather/weather-metar.c +++ b/libgweather/weather-metar.c @@ -1,31 +1,17 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* weather-metar.c - Weather server functions (METAR) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #include <stdlib.h> #include <string.h> #include <sys/types.h> -#include "gweather-private.h" - enum { TIME_RE, WIND_RE, diff --git a/libgweather/weather-metno.c b/libgweather/weather-metno.c index 2145ac7..d5b09bd 100644 --- a/libgweather/weather-metno.c +++ b/libgweather/weather-metno.c @@ -1,26 +1,12 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* weather-metno.c - MET Norway Weather service. * - * Copyright 2012 Giovanni Campagna <scampa.giovanni@gmail.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2012 Giovanni Campagna <scampa.giovanni@gmail.com> + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #include <time.h> #include <stdlib.h> @@ -33,8 +19,6 @@ #include <libxml/xpath.h> #include <libxml/xpathInternals.h> -#include "gweather-private.h" - #define XC(t) ((const xmlChar *)(t)) /* As per https://gitlab.gnome.org/GNOME/libgweather/-/issues/59#note_1004747 */ @@ -455,4 +439,3 @@ metno_start_open (GWeatherInfo *info) return TRUE; } - diff --git a/libgweather/weather-moon.c b/libgweather/weather-moon.c index 898fdb7..379b921 100644 --- a/libgweather/weather-moon.c +++ b/libgweather/weather-moon.c @@ -1,19 +1,7 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* weather-moon.c - Lunar calculations for gweather * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ /* @@ -22,9 +10,9 @@ * Cambridge University Press 1988 */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #ifdef __FreeBSD__ #include <sys/types.h> @@ -35,8 +23,6 @@ #include <string.h> #include <glib.h> -#include "gweather-private.h" - /* * Elements of the Moon's orbit, epoch 2000 Jan 1.5 * http://ssd.jpl.nasa.gov/?sat_elem#earth @@ -44,7 +30,7 @@ */ #define LUNAR_MEAN_LONGITUDE 218.316 -#define LUNAR_PERIGEE_MEAN_LONG 318.15 +#define LUNAR_PERIGEE_MEAN_LONG 318.15 #define LUNAR_NODE_MEAN_LONG 125.08 #define LUNAR_PROGRESSION 13.176358 #define LUNAR_INCLINATION DEGREES_TO_RADIANS(5.145396) diff --git a/libgweather/weather-owm.c b/libgweather/weather-owm.c index 9bcd6a1..2976be1 100644 --- a/libgweather/weather-owm.c +++ b/libgweather/weather-owm.c @@ -1,24 +1,12 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* weather-owm.c - Open Weather Map backend * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #include <stdio.h> #include <stdlib.h> @@ -34,8 +22,6 @@ #include <libxml/xpath.h> #include <libxml/xpathInternals.h> -#include "gweather-private.h" - #define XC(t) ((const xmlChar *)(t)) /* Reference for symbols at http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes */ diff --git a/libgweather/weather-sun.c b/libgweather/weather-sun.c index 22b80b4..7330ca4 100644 --- a/libgweather/weather-sun.c +++ b/libgweather/weather-sun.c @@ -1,19 +1,7 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* weather-sun.c - Astronomy calculations for gweather * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * <https://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: The GWeather authors + * SPDX-License-Identifier: GPL-2.0-or-later */ /* @@ -24,16 +12,14 @@ * the algorithm presented in section 49 of above */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#include "config.h" + +#include "gweather-private.h" #include <math.h> #include <time.h> #include <glib.h> -#include "gweather-private.h" - #define ECCENTRICITY(d) (0.01671123 - (d)/36525.*0.00004392) /* |