From patchwork Mon Oct 16 16:57:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1849480 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=XK+tsSmg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53e; helo=mail-ed1-x53e.google.com; envelope-from=swupdate+bncbaabbcgxwwuqmgqezfhgdxi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ed1-x53e.google.com (mail-ed1-x53e.google.com [IPv6:2a00:1450:4864:20::53e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S8Nb41G3Bz23k4 for ; Tue, 17 Oct 2023 03:57:51 +1100 (AEDT) Received: by mail-ed1-x53e.google.com with SMTP id 4fb4d7f45d1cf-53e07fe8dc1sf3680041a12.0 for ; Mon, 16 Oct 2023 09:57:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697475466; cv=pass; d=google.com; s=arc-20160816; b=vMlHYQkuhAVW9po4/NpWfzQLqcET+OG12xqAbvokKVWT4GpUBQTQhnNo0PjhDFF7a0 qBitTBFNVjzgEFH59zYqcqpZMTt82GB5nC0lrgK+3V/uMJL85PqBHETaXqYgwd94X3xI qPiAk9P0KSoGFRxuAJ5roFkEgGfj53NnU/5ZcAvA5bzsNzU8be4lwzX15cKKA1QtxNbq VupE90n9PZMZrO0P/BuwTQy/ft3fin8TfOajyUOBhc3w3MSF3hncviWJvC+nnkR33mEj eCjKUoAPaMNVJwIAAnBev8c7n/vDii5oD8Nv/KWRnCLpRXy1GI3dh/HyaOG6YoG91Du1 zzTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=91F6NizU5JIdsSk/jXlF6pSU7MYmXIWbssa1vpCTW2U=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=TeVFMjdgbz+jRFhGHGpVxAwh3nYCwn457h7NVx2knIZ2shVC6BYfkmRbEI95I95msa Wy2my3F4we1KdGJ4e4zNW2O32Yk77SRIMOCr/7jhoIXC/EbDCsYKlKdm7qepd+00CBVx BPE6EU6T232bLtTyysZOWq8iy/Z7A7Oi5n8tbbN/LoBYa2kMlrlDUejTW1XXFzz0ozHp CXcJC3agsU3/cMnU+MbUpAYIDldqrTyuA24hBmT0C/aBF0EOaUyt857ia6M44BmhMM+l GMjztUPrzg60zEsO2b+U1l+oaP1A+GaqIVQsz37C67NVLzV4b5C5rXrwCcP+pxYRo9ON wQUw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1697475465; x=1698080265; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:message-id:date :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=91F6NizU5JIdsSk/jXlF6pSU7MYmXIWbssa1vpCTW2U=; b=XK+tsSmgnFhxCoUFofBo1b4MScOEwU/DE5tyUihvDrsMXzL0cmy4wwxs1r0p0n/7bM umKIcEsDKXZBjfLX0+rYcbd4o864WsZc8qPMkt6H9dNi5XYjZ2g63j72w7f5/ReDC44B 6FmUkbqpTbDoZWlIpuUOpBvaiiMNkcQw2/X33/vOtXg25JvOxAOv/M+qOpljI8rrOSLb C80z+43QKbWO3eOz1KOqmVfO+we190IW9kLO82+Jrekw1IfZOjvET3hIE8eHdu+B2lux 5hpkizWJUdE5UD546qCukfAOWnrnrz5YVSDnPjNb1CBME7cskE3m33CFzjlS8v4WFykD JYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697475465; x=1698080265; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=91F6NizU5JIdsSk/jXlF6pSU7MYmXIWbssa1vpCTW2U=; b=YCmHiTjY3jHmGGujLM6U4Wn/C0BI6kQZJG9uqQ8oyvi7XfP0VO7yM5jo6PDLAjn01a 3r/BMe7CeRkSqkDMLcJLcUDGHmciEYU6aCaG200nXSZoJ49sM9LSQ0OzRhSb6RmnbAax Gs4ijfHb2MG7x8fO4dUKDY1BHu2S2TB4Aqaurk78/jFTKtqzrxVgL9ZfnAILM7er2icI wkR0ZmxY1UA8AoFM/wUUIMYoLBS/Y38b/C0QroGY/DPRPm7mIkI9fqF2dxTXlchnCEcO NaDDYFfZ/EDH5MGt4GQNtlWajFF7xUMCmLk8D4vwqcWy8nPAXEwjM2fbS0PL6eXLuU3m uRyA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0YwGqbTtsFXt9BK4QsV7bx/pmdSavtNi4MkBXYxktb/ZcoVb9gHi awthJjk2oc3254FiRoR80Os= X-Google-Smtp-Source: AGHT+IGAwj/bqFe1M25/iQoAdgbGQJGQPXrsAWYLzEqJty5sMy9VVS+bLcD6mWBzoQcvGGPFADaKUA== X-Received: by 2002:a50:9fe9:0:b0:53e:47e9:9614 with SMTP id c96-20020a509fe9000000b0053e47e99614mr6914513edf.7.1697475465530; Mon, 16 Oct 2023 09:57:45 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:3785:b0:537:87c9:54c1 with SMTP id et5-20020a056402378500b0053787c954c1ls857503edb.2.-pod-prod-05-eu; Mon, 16 Oct 2023 09:57:43 -0700 (PDT) X-Received: by 2002:a17:907:968d:b0:9c3:cefa:93c6 with SMTP id hd13-20020a170907968d00b009c3cefa93c6mr3862073ejc.10.1697475463807; Mon, 16 Oct 2023 09:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697475463; cv=none; d=google.com; s=arc-20160816; b=0FCq2PgFwjtiHk4NNz6G1u/GHcDHdd4tCxAMkNFGrQxQcjErvehNdyBx8UrWS4O/9e fFVwxlXyZaEa2NzKZ4l04UBaVc9O6/4S8ad4ivPrvZ6rvDkrv6yLoTvIhYb3O+NfwW5m OztTaO2sEIWtCJohyggnak3wwYEuzn0bc6SWzqp6RFDxSFpSIFr8g2ML7PyRjDO0wNxI apc2ZY9LqIrriL4k7Sx80OC0BMJsqWVLpZq6sgXDI/OXJ8zGsPD5Sir6l1Y2E9mdKUr8 HhStbQCa9qO9ffxqFxr8pV5vQP2163doBf2vs3J0GAwJ7ew6MwexD9Jk6T+EXGJYdQdR lidw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from; bh=iR8wPZTT4uzElVoqLJ++M1RyeTzCbTy+Zz2ZgJa3uPI=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=ZhcYTLftDif82YpLtch/CrBbeiroAuWI6M11KKJZRq+nw5kunKdrO9oEVrcGDJE9ky xf/vYb62TewrYMH1KZKyrNFVTCWy4wxM1a9De0qYMKEyOnrEiruo1TXny3gqM8zmnt8n eXLvsdvL2F5jxEjioWjh4c+pE1CNm3+x4vrbC9jnO6B8vksjeQxjloJw+nhBoZ2ehG5e wlBlaLRFVAsWf/yPflTjv9h9Yga6YmGfwDk9ruaCdrfFD8+ir3yCnvvK3es10l0GqBBU GBS1iIy6j4DZAapUf5VZsf7nj/jDY9L0kPIsgTaGISTj0+CuahR+3l3E29PCLi3R1cWS LVrg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.75]) by gmr-mx.google.com with ESMTPS id sh30-20020a1709076e9e00b009adbab54deesi342433ejc.2.2023.10.16.09.57.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) client-ip=217.72.192.75; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MRCFu-1rDHiV0h2i-00ND8c; Mon, 16 Oct 2023 18:57:43 +0200 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 01/12] Cleanup: use #pragma once in all headers Date: Mon, 16 Oct 2023 18:57:29 +0200 Message-Id: <20231016165740.1374614-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:rA5Nj3ASUYXQYdVIYvLLHOOjHQdQ0BiI967CHKRa1w39JHR/NqD 8IOk86FkBWuqFkrtB5DQeO5pj5XGr6UA9SP/6bVnhcODC0NDANVqQZhMjNy2M6E2l5yDu6c osgGKMYKxF+WuT0ocs1wAnXwpnp7a3ZuMthsktAAb1Vd6m7ttc/wWNNtrhyDRI6UfW08Orp n7C2oX5AEjBHv7BXwJTrQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:nk9MP/oj9y0=;tWjjSxwjFvycPBeLYyLjDiJ3fWC SqpTxEFJvhHr6HaYHWO2GbayQPZkPO/GtGjydFnadu7b8qOKESEYZr/hGdNA7wVE0x4SnTYW/ lOvqoipHKK2cM+xPvrJ7FojC7/fs6nXaIvnoKWhDBMws76PuIl0juJfiOk2K/lppiU7djR59O K/QoKPKqORhKW4S7zwUXmMj7cemD3Env/0AqIrmJEtJG5MO1E62ZvMjVQHJ9Tm0i/TErFsru0 poNbCXavYhyGpQ6r0Ds1nqWnvfLDbrniabZKOouIvHTH+0JbCyvDv/GCX6Lprx7rO387X0/eF 9zqWZAOdQZhqy/GLUdGoN94eMpUFDp8a0NHlhW3BcI+Xe9FBGrnR9i2sK+95lemedh6o9lIG2 IaF9z0DDVxTOdP7UTkcWy7kSZz5p2uBgd9jAOzyyNzrkmsvzIFDWWaVdf55AAUqU1+BZcvnO/ EoRUrANNQBpVj9UJ6OO3dahrGibDE58jbNdfNxxB1o1WlemtzA15ApnS59BrRQls7tLTq5HT8 TLXa3LV6+H+X11tUBrTW8w8T3rYYyCjE/3hL/zVpOLKL2k12OwV0Di6phmckL9YJ8d7U12NgF XdJ42JntEnU33ugoX7VB3qF21Uzl4+4zZSgfwLhnBXWgDteVRGM7I/Qm2wzQBD2hucExrSD8I nW57a86xvnpZGOg8jrWDyb11hnL+z6PYkuGxgJOapWDxPney3wotEWI4GkPBJAQZeE4NzGaps 3a9DreioA7gEWarpyuUivzLg+mYqn7M6Ths7YPNfAUTt2153qqYdvti1kC+ReCfFrPEzHh2vO JPPlGOuRnvw6ouVuYh/i53TPXLg/Z2RZeObXVjf5M8a4cm3JSnDXWkpsoQ23Si30vh4qeBbSi qkacWMRbRLdy9WV++UmNZTPPNPwgoj5irr4o= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , There is a mix of #ifndef and #pragma once to check if a header is already include. Drop the mix and use the pragma in all headers. Uodate SPDX to current information. Signed-off-by: Stefano Babic Reviewed-by: Dominique Martinet --- include/bootloader.h | 2 +- include/chained_handler.h | 2 +- include/cpiohdr.h | 7 ++----- include/delta_process.h | 2 +- include/download_interface.h | 7 ++----- include/flash.h | 7 ++----- include/fs_interface.h | 6 ++---- include/globals.h | 8 ++------ include/handler.h | 8 ++------ include/hw-compatibility.h | 11 +++-------- include/installer.h | 7 ++----- include/installer_priv.h | 8 ++------ include/lua_util.h | 12 +++--------- include/mongoose_interface.h | 9 +++------ include/multipart_parser.h | 4 +--- include/network_interface.h | 10 +++------- include/network_ipc.h | 10 +++------- include/parselib.h | 10 +++------- include/parsers.h | 9 +++------ include/pctl.h | 9 +++------ include/progress.h | 9 +++------ include/progress_ipc.h | 5 +---- include/semver.h | 5 +---- include/server_utils.h | 2 +- include/sslapi.h | 6 +----- include/swupdate.h | 9 +++------ include/swupdate_dict.h | 9 +++------ include/swupdate_image.h | 8 ++------ include/swupdate_settings.h | 9 +++------ include/swupdate_status.h | 10 +++------- include/swupdate_vars.h | 5 +---- include/util.h | 8 +++----- include/versions.h | 7 ++----- 33 files changed, 71 insertions(+), 169 deletions(-) diff --git a/include/bootloader.h b/include/bootloader.h index 171181ec..365d6dc3 100644 --- a/include/bootloader.h +++ b/include/bootloader.h @@ -1,6 +1,6 @@ /* * (C) Copyright 2017 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ diff --git a/include/chained_handler.h b/include/chained_handler.h index 3ab82fa7..fdd831dd 100644 --- a/include/chained_handler.h +++ b/include/chained_handler.h @@ -1,6 +1,6 @@ /* * (C) Copyright 2022 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ diff --git a/include/cpiohdr.h b/include/cpiohdr.h index 0be844a9..c909af94 100644 --- a/include/cpiohdr.h +++ b/include/cpiohdr.h @@ -1,6 +1,6 @@ /* * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ @@ -11,8 +11,7 @@ * but just what is needed by swupdate */ -#ifndef _CPIOHDR_SWUPD_H -#define _CPIOHDR_SWUPD_H +#pragma once /* Global swupdate defines */ #include @@ -61,5 +60,3 @@ int extract_cpio_header(int fd, struct filehdr *fhdr, unsigned long *offset); int extract_img_from_cpio(int fd, unsigned long offset, struct filehdr *fdh); void extract_padding(int fd); bool swupdate_verify_chksum(const uint32_t chk1, struct filehdr *fhdr); - -#endif diff --git a/include/delta_process.h b/include/delta_process.h index 51d1e042..ace40742 100644 --- a/include/delta_process.h +++ b/include/delta_process.h @@ -1,6 +1,6 @@ /* * (C) Copyright 2021 - * Stefano Babic, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ diff --git a/include/download_interface.h b/include/download_interface.h index 8e031306..6cc099d0 100644 --- a/include/download_interface.h +++ b/include/download_interface.h @@ -1,13 +1,12 @@ /* * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _DWL_INTERFACE_H -#define _DWL_INTERFACE_H +#pragma once /* * This is used by swupdate to start the Downloader Process @@ -15,5 +14,3 @@ int start_download_server(const char *cfgfname, int argc, char *argv[]); void download_print_help(void); - -#endif diff --git a/include/flash.h b/include/flash.h index 3f730799..9a055a72 100644 --- a/include/flash.h +++ b/include/flash.h @@ -1,13 +1,12 @@ /* * (C) Copyright 2014 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _FLASH_PART_H -#define _FLASH_PART_H +#pragma once #include #include @@ -58,5 +57,3 @@ struct flash_description *get_flash_info(void); #define isNand(flash, index) \ (flash->mtd_info[index].mtd.type == MTD_NANDFLASH || \ flash->mtd_info[index].mtd.type == MTD_MLCNANDFLASH) - -#endif diff --git a/include/fs_interface.h b/include/fs_interface.h index dabdec3f..cab3dec6 100644 --- a/include/fs_interface.h +++ b/include/fs_interface.h @@ -1,11 +1,10 @@ /* - * Copyright (C) 2021 Stefano Babic + * Copyright (C) 2021 Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _FS_INTERFACE_H -#define _FS_INTERFACE_H +#pragma once char *diskformat_fs_detect(char *device); int diskformat_fs_exists(char *device, char *fstype); @@ -24,4 +23,3 @@ extern int ext_mkfs(const char *device_name, const char *fstype, unsigned long f #if defined (CONFIG_BTRFS_FILESYSTEM) extern int btrfs_mkfs(const char *device_name, const char *fstype); #endif -#endif diff --git a/include/globals.h b/include/globals.h index a30ec7c6..8aeb3f4d 100644 --- a/include/globals.h +++ b/include/globals.h @@ -1,12 +1,11 @@ /* * (C) Copyright 2014 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GLOBALS_H -#define _GLOBALS_H +#pragma once #define BANNER "SWUpdate v" SWU_VER "\n" @@ -31,6 +30,3 @@ #define SCRIPTS_DIR_SUFFIX "scripts/" #define DATADST_DIR_SUFFIX "datadst/" #define BOOT_SCRIPT_SUFFIX "boot-script" - -#endif - diff --git a/include/handler.h b/include/handler.h index 40ff9c04..b0b18149 100644 --- a/include/handler.h +++ b/include/handler.h @@ -1,14 +1,12 @@ /* * (C) Copyright 2012-2013 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. - * on behalf of ifm electronic GmbH + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _HANDLER_H -#define _HANDLER_H +#pragma once struct img_type; typedef enum { @@ -58,5 +56,3 @@ struct installer_handler *find_handler(struct img_type *img); void print_registered_handlers(void); struct installer_handler *get_next_handler(void); unsigned int get_handler_mask(struct img_type *img); - -#endif diff --git a/include/hw-compatibility.h b/include/hw-compatibility.h index 3c2dca82..97d43c24 100644 --- a/include/hw-compatibility.h +++ b/include/hw-compatibility.h @@ -1,13 +1,11 @@ /* - * (C) Copyright 2023 - * Stefano Babic, sbabic@denx.de. + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_HW_COMPATIBILITY_H -#define _SWUPDATE_HW_COMPATIBILITY_H - +#pragma once #include "bsdqueue.h" #include "globals.h" @@ -21,6 +19,3 @@ LIST_HEAD(hwlist, hw_type); int check_hw_compatibility(struct hw_type *hwt, struct hwlist *hardware); int get_hw_revision(struct hw_type *hw); - -#endif - diff --git a/include/installer.h b/include/installer.h index 80aa4426..613ecc71 100644 --- a/include/installer.h +++ b/include/installer.h @@ -1,13 +1,12 @@ /* * (C) Copyright 2013 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _INSTALLER_H -#define _INSTALLER_H +#pragma once #include #include "swupdate.h" @@ -23,5 +22,3 @@ int install_from_file(const char *filename, bool check); int postupdate(struct swupdate_cfg *swcfg, const char *info); int preupdatecmd(struct swupdate_cfg *swcfg); void cleanup_files(struct swupdate_cfg *software); - -#endif diff --git a/include/installer_priv.h b/include/installer_priv.h index 901dbf4e..d1e3a4df 100644 --- a/include/installer_priv.h +++ b/include/installer_priv.h @@ -1,13 +1,11 @@ /* * (C) Copyright 2020 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _INSTALLER_PRIV_H -#define _INSTALLER_PRIV_H - +#pragma once #include "swupdate_status.h" #include "network_ipc.h" @@ -20,5 +18,3 @@ struct installer { struct swupdate_request req; struct swupdate_cfg *software; }; - -#endif diff --git a/include/lua_util.h b/include/lua_util.h index 4974eeb7..1d00bf82 100644 --- a/include/lua_util.h +++ b/include/lua_util.h @@ -1,14 +1,11 @@ /* - * (C) Copyright 2013 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. - * on behalf of ifm electronic GmbH + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _LUA_UTIL_H -#define _LUA_UTIL_H - +#pragma once #ifdef CONFIG_LUA #include "lua.h" #include "lauxlib.h" @@ -92,6 +89,3 @@ static inline int lua_parser_fn(lua_State __attribute__ ((__unused__)) *L, struct img_type __attribute__ ((__unused__)) *img) { return -1; } static inline int lua_handlers_init(void) { return 0; } #endif - - -#endif diff --git a/include/mongoose_interface.h b/include/mongoose_interface.h index 845f7cbf..3ed7b4fb 100644 --- a/include/mongoose_interface.h +++ b/include/mongoose_interface.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2012-2014 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2012-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _MONGOOSE_INTERFACE_H -#define _MONGOOSE_INTERFACE_H +#pragma once /* * Max number of command line options @@ -19,5 +18,3 @@ int start_mongoose(const char *cfgfname, int argc, char *argv[]); void mongoose_print_help(void); - -#endif diff --git a/include/multipart_parser.h b/include/multipart_parser.h index 0282e50a..71e4440d 100644 --- a/include/multipart_parser.h +++ b/include/multipart_parser.h @@ -3,8 +3,7 @@ * * SPDX-License-Identifier: MIT */ -#ifndef _multipart_parser_h -#define _multipart_parser_h +#pragma once #ifdef __cplusplus extern "C" { @@ -46,4 +45,3 @@ void *multipart_parser_get_data(multipart_parser * p); #ifdef __cplusplus } /* extern "C" */ #endif -#endif diff --git a/include/network_interface.h b/include/network_interface.h index 5f138ad4..a636d990 100644 --- a/include/network_interface.h +++ b/include/network_interface.h @@ -1,14 +1,11 @@ /* - * (C) Copyright 2013 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de - * on behalf of ifm electronic GmbH + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _NETWORK_INTERFACE_H -#define _NETWORK_INTERFACE_H - +#pragma once void *network_initializer(void *data); void *network_thread(void *data); int listener_create(const char *path, int type); @@ -16,4 +13,3 @@ int listener_create(const char *path, int type); extern bool stream_wkup; extern pthread_mutex_t stream_mutex; extern pthread_cond_t stream_cond; -#endif diff --git a/include/network_ipc.h b/include/network_ipc.h index 4ce8ff4e..e0ef14a3 100644 --- a/include/network_ipc.h +++ b/include/network_ipc.h @@ -1,13 +1,11 @@ /* - * (C) Copyright 2008-2017 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. - * on behalf of ifm electronic GmbH + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifndef _IPC_H -#define _IPC_H +#pragma once #include #include @@ -157,5 +155,3 @@ int swupdate_set_version_range(const char *minversion, #ifdef __cplusplus } // extern "C" #endif - -#endif diff --git a/include/parselib.h b/include/parselib.h index a027d53a..7baf555d 100644 --- a/include/parselib.h +++ b/include/parselib.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2016-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _PARSE_LIBRARY_H -#define _PARSE_LIBRARY_H +#pragma once #include #include @@ -112,6 +111,3 @@ bool set_find_path(const char **nodes, const char *newpath, char **tmp); d[0] = '\0'; \ GET_FIELD_STRING(p, e, name, d); \ } while (0) - - -#endif diff --git a/include/parsers.h b/include/parsers.h index e13f3b0d..0e94c2b6 100644 --- a/include/parsers.h +++ b/include/parsers.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2008-2013 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _RECOVERY_PARSERS_H -#define _RECOVERY_PARSERS_H +#pragma once #include "generated/autoconf.h" @@ -22,5 +21,3 @@ int parse(struct swupdate_cfg *swcfg, const char *filename); int parse_cfg (struct swupdate_cfg *swcfg, const char *filename); int parse_json(struct swupdate_cfg *swcfg, const char *filename); int parse_external(struct swupdate_cfg *swcfg, const char *filename); -#endif - diff --git a/include/pctl.h b/include/pctl.h index f8e2f9b0..d59f8319 100644 --- a/include/pctl.h +++ b/include/pctl.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2016-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_PCTL_H -#define _SWUPDATE_PCTL_H +#pragma once #include #include @@ -54,5 +53,3 @@ int pctl_getfd_from_type(sourcetype s); const char *pctl_getname_from_type(sourcetype s); int run_system_cmd(const char *cmd); int run_function_background(void *fn, int argc, char **argv); - -#endif diff --git a/include/progress.h b/include/progress.h index 513b26db..de680f47 100644 --- a/include/progress.h +++ b/include/progress.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2016-2023 + * Stefano Babic, * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _INSTALL_PROGRESS_H -#define _INSTALL_PROGRESS_H +#pragma once #include #include @@ -28,5 +27,3 @@ void swupdate_progress_info(RECOVERY_STATUS status, int cause, const char *msg); void swupdate_download_update(unsigned int perc, unsigned long long totalbytes, sourcetype source); void *progress_bar_thread (void *data); - -#endif diff --git a/include/progress_ipc.h b/include/progress_ipc.h index 5d0be1ca..e00a081f 100644 --- a/include/progress_ipc.h +++ b/include/progress_ipc.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifndef _PROGRESS_IPC_H -#define _PROGRESS_IPC_H +#pragma once #include #include @@ -55,5 +54,3 @@ int progress_ipc_receive(int *connfd, struct progress_msg *msg); #ifdef __cplusplus } // extern "C" #endif - -#endif diff --git a/include/semver.h b/include/semver.h index e4d92950..37f85a75 100644 --- a/include/semver.h +++ b/include/semver.h @@ -6,8 +6,7 @@ * SPDX-License-Identifier: MIT */ -#ifndef __SEMVER_H -#define __SEMVER_H +#pragma once #ifdef __cplusplus extern "C" { @@ -102,5 +101,3 @@ semver_clean (char *s); #ifdef __cplusplus } #endif - -#endif diff --git a/include/server_utils.h b/include/server_utils.h index 8b249d51..9cca3a90 100644 --- a/include/server_utils.h +++ b/include/server_utils.h @@ -1,6 +1,6 @@ /* * (C) Copyright 2018 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ diff --git a/include/sslapi.h b/include/sslapi.h index 4668fe78..9f5b061c 100644 --- a/include/sslapi.h +++ b/include/sslapi.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_SSL_H -#define _SWUPDATE_SSL_H +#pragma once #include #include "util.h" @@ -221,6 +220,3 @@ UNUSED static inline struct swupdate_digest *swupdate_DECRYPT_init( #define SSL_PURPOSE_CODE_SIGN -1 #define SSL_PURPOSE_DEFAULT -1 #endif - -#endif - diff --git a/include/swupdate.h b/include/swupdate.h index 3e1d160f..8f768a72 100644 --- a/include/swupdate.h +++ b/include/swupdate.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2012-2014 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2013-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_H -#define _SWUPDATE_H +#pragma once #include #include @@ -111,5 +110,3 @@ struct swupdate_cfg { int cpio_scan(int fd, struct swupdate_cfg *cfg, off_t start); struct swupdate_cfg *get_swupdate_cfg(void); void free_image(struct img_type *img); - -#endif diff --git a/include/swupdate_dict.h b/include/swupdate_dict.h index 0e949895..eb6f0ff0 100644 --- a/include/swupdate_dict.h +++ b/include/swupdate_dict.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2016-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWDICT_H -#define _SWDICT_H +#pragma once #include @@ -35,5 +34,3 @@ int dict_insert_value(struct dict *dictionary, const char *key, const char *valu void dict_remove(struct dict *dictionary, const char *key); void dict_drop_db(struct dict *dictionary); int dict_parse_script(struct dict *dictionary, const char *script); - -#endif diff --git a/include/swupdate_image.h b/include/swupdate_image.h index 7f6c015f..592a886b 100644 --- a/include/swupdate_image.h +++ b/include/swupdate_image.h @@ -1,12 +1,11 @@ /* * (C) Copyright 2023 - * Stefano Babic, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_IMAGE_H -#define _SWUPDATE_IMAGE_H +#pragma once #include #include @@ -72,6 +71,3 @@ struct img_type { }; LIST_HEAD(imglist, img_type); - -#endif - diff --git a/include/swupdate_settings.h b/include/swupdate_settings.h index 108b9fb2..073cc7cc 100644 --- a/include/swupdate_settings.h +++ b/include/swupdate_settings.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2016-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_SETTINGS_H -#define _SWUPDATE_SETTINGS_H +#pragma once #include @@ -69,5 +68,3 @@ static inline int settings_into_dict(void __attribute__ ((__unused__)) *settings return -1; } #endif - -#endif diff --git a/include/swupdate_status.h b/include/swupdate_status.h index 29eea0f5..6d737cbc 100644 --- a/include/swupdate_status.h +++ b/include/swupdate_status.h @@ -1,13 +1,11 @@ /* - * (C) Copyright 2015-2017 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2015-2023 + * Stefano Babic * * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifndef _SWUPDATE_STATUS_H -#define _SWUPDATE_STATUS_H - +#pragma once #ifdef __cplusplus extern "C" { #endif @@ -42,5 +40,3 @@ typedef enum { #ifdef __cplusplus } // extern "C" #endif - -#endif diff --git a/include/swupdate_vars.h b/include/swupdate_vars.h index 0334f427..cbff84e5 100644 --- a/include/swupdate_vars.h +++ b/include/swupdate_vars.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWVARS_H -#define _SWVARS_H +#pragma once #include @@ -15,5 +14,3 @@ int swupdate_vars_apply_list(const char *filename, const char *namespace); char *swupdate_vars_get(const char *name, const char *namespace); int swupdate_vars_set(const char *name, const char *value, const char *namespace); int swupdate_vars_unset(const char *name, const char *namespace); - -#endif diff --git a/include/util.h b/include/util.h index 4202caa4..dc0b957b 100644 --- a/include/util.h +++ b/include/util.h @@ -1,12 +1,11 @@ /* - * (C) Copyright 2012-2016 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. + * (C) Copyright 2012-2023 + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _UTIL_H -#define _UTIL_H +#pragma once #include #include @@ -272,4 +271,3 @@ int swupdate_umount(const char *dir); /* Date / Time utilities */ char *swupdate_time_iso8601(struct timeval *tv); -#endif diff --git a/include/versions.h b/include/versions.h index b85f7189..7f883be2 100644 --- a/include/versions.h +++ b/include/versions.h @@ -1,15 +1,12 @@ /* * (C) Copyright 2023 - * Stefano Babic, sbabic@denx.de. + * Stefano Babic * * SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _SWUPDATE_VERSION_H -#define _SWUPDATE_VERSION_H +#pragma once #include "swupdate_settings.h" void get_sw_versions(swupdate_cfg_handle *handle, struct swupdate_cfg *sw); -#endif -