From 34b59a80119cc4e1b46a48b36bc0ece11d09a19c Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Tue, 7 Aug 2018 20:27:29 +0200 Subject: [PATCH] Remove the no more used gmt2local() function --- CMakeLists.txt | 1 - INSTALL.txt | 2 -- Makefile.in | 2 -- gmt2local.c | 66 ---------------------------------------- gmt2local.h | 25 --------------- win32/prj/GNUmakefile | 1 - win32/prj/WinDump.dsp | 4 --- win32/prj/WinDump.vcproj | 22 -------------- 8 files changed, 123 deletions(-) delete mode 100644 gmt2local.c delete mode 100644 gmt2local.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ab5f8355..05b4e196 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -899,7 +899,6 @@ set(NETDISSECT_SOURCE_LIST_C checksum.c cpack.c gmpls.c - gmt2local.c in_cksum.c ipproto.c l2vpn.c diff --git a/INSTALL.txt b/INSTALL.txt index 682c31be..662eb0c3 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -70,8 +70,6 @@ ethertype.h - Ethernet type value definitions extract.h - alignment definitions gmpls.c - GMPLS definitions gmpls.h - GMPLS declarations -gmt2local.c - time conversion routines -gmt2local.h - time conversion prototypes install-sh - BSD style install script interface.h - globals, prototypes and definitions ip.h - IP definitions diff --git a/Makefile.in b/Makefile.in index d53735b0..545cc33d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -80,7 +80,6 @@ LIBNETDISSECT_SRC=\ checksum.c \ cpack.c \ gmpls.c \ - gmt2local.c \ in_cksum.c \ ipproto.c \ l2vpn.c \ @@ -267,7 +266,6 @@ HDR = \ getopt_long.h \ getservent.h \ gmpls.h \ - gmt2local.h \ interface.h \ ip.h \ ip6.h \ diff --git a/gmt2local.c b/gmt2local.c deleted file mode 100644 index fbfba64d..00000000 --- a/gmt2local.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1997 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "netdissect-stdinc.h" - -#include - -#ifdef HAVE_OS_PROTO_H -#include "os-proto.h" -#endif - -#include "gmt2local.h" - -/* - * Returns the difference between gmt and local time in seconds. - * Use gmtime() and localtime() to keep things simple. - */ -int32_t -gmt2local(time_t t) -{ - int dt, dir; - struct tm *gmt, *loc; - struct tm sgmt; - - if (t == 0) - t = time(NULL); - gmt = &sgmt; - *gmt = *gmtime(&t); - loc = localtime(&t); - dt = (loc->tm_hour - gmt->tm_hour) * 60 * 60 + - (loc->tm_min - gmt->tm_min) * 60; - - /* - * If the year or julian day is different, we span 00:00 GMT - * and must add or subtract a day. Check the year first to - * avoid problems when the julian day wraps. - */ - dir = loc->tm_year - gmt->tm_year; - if (dir == 0) - dir = loc->tm_yday - gmt->tm_yday; - dt += dir * 24 * 60 * 60; - - return (dt); -} diff --git a/gmt2local.h b/gmt2local.h deleted file mode 100644 index 89254df9..00000000 --- a/gmt2local.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 1997 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ -#ifndef gmt2local_h -#define gmt2local_h - -int32_t gmt2local(time_t); -#endif diff --git a/win32/prj/GNUmakefile b/win32/prj/GNUmakefile index a7b63e8a..d5fe3ec1 100644 --- a/win32/prj/GNUmakefile +++ b/win32/prj/GNUmakefile @@ -31,7 +31,6 @@ OBJS = \ ../../af.o \ ../../checksum.o \ ../../gmpls.o \ - ../../gmt2local.o \ ../../missing/inet_aton.o \ ../../missing/inet_ntop.o \ ../../missing/strlcpy.o \ diff --git a/win32/prj/WinDump.dsp b/win32/prj/WinDump.dsp index 6f7276ee..1808774e 100644 --- a/win32/prj/WinDump.dsp +++ b/win32/prj/WinDump.dsp @@ -129,10 +129,6 @@ SOURCE=..\..\gmpls.c # End Source File # Begin Source File -SOURCE=..\..\gmt2local.c -# End Source File -# Begin Source File - SOURCE=..\..\in_cksum.c # End Source File # Begin Source File diff --git a/win32/prj/WinDump.vcproj b/win32/prj/WinDump.vcproj index fb13a855..0fead8fa 100644 --- a/win32/prj/WinDump.vcproj +++ b/win32/prj/WinDump.vcproj @@ -446,28 +446,6 @@ /> - - - - - - - - -- 2.39.5