Re: [Grubby - PATCH 1/4] Add forward declarations for functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-06-11 at 19:29 +0300, Adrian Perez wrote:
> Certain compilers may spit out a huge amount of warnings about
> missing prototypes, or even fail to compile grubby.c if they
> default to the C99 standard. This adds the missing prototypes
> at the beginning of the source file, also marking the functions
> as static -- they are not going to be used anywhere else after
> all.
Wouldn't it be better to put these in a grubby.h file and then include
it? I know that being static they are not going to be used anywhere
else, but we still could have the prototypes in the header file where
they belong.

> ---
>  grubby.c |   89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 89 insertions(+)
> 
> diff --git a/grubby.c b/grubby.c
> index fe8317d..71edce7 100644
> --- a/grubby.c
> +++ b/grubby.c
> @@ -124,11 +124,100 @@ struct keywordTypes {
>  };
>  
>  struct configFileInfo;
> +struct grubConfig;
>  
>  typedef const char *(*findConfigFunc)(struct configFileInfo *);
>  typedef const int (*writeLineFunc)(struct configFileInfo *,
>  				struct singleLine *line);
>  
> +static const char *grubFindConfig(struct configFileInfo *cfi);
> +static const char *grub2FindConfig(struct configFileInfo *cfi);
> +static char *grub2ExtractTitle(struct singleLine * line);
> +static int argMatch(const char * one, const char * two);
> +static int sizeOfSingleLine(struct singleLine * line);
> +static void removeLine(struct singleEntry * entry, struct singleLine * line);
> +static void printEntry(struct singleEntry * entry);
> +static void notSuitablePrintf(struct singleEntry * entry, const char *fmt, ...);
> +static char * findBootPrefix(void);
> +
> +static int suitableImage(struct singleEntry * entry,
> +                         const char * bootPrefix,
> +                         int skipRemoved,
> +                         int flags);
> +
> +static void markRemovedImage(struct grubConfig * cfg,
> +                             const char * image,
> +                             const char * prefix);
> +
> +static void setFallbackImage(struct grubConfig * config,
> +                             int hasNew);
> +
> +static void setDefaultImage(struct grubConfig * config,
> +                            int hasNew,
> +                            const char * defaultKernelPath,
> +                            int newIsDefault,
> +                            const char * prefix,
> +                            int flags);
> +
> +static int updateActualImage(struct grubConfig * cfg,
> +                             const char * image,
> +                             const char * prefix,
> +                             const char * addArgs,
> +                             const char * removeArgs,
> +                             int multibootArgs);
> +
> +static int updateImage(struct grubConfig * cfg,
> +                       const char * image,
> +                       const char * prefix,
> +                       const char * addArgs,
> +                       const char * removeArgs,
> +                       const char * addMBArgs,
> +                       const char * removeMBArgs);
> +
> +static int updateInitrd(struct grubConfig * cfg,
> +                        const char * image,
> +                        const char * prefix,
> +                        const char * initrd);
> +
> +static struct singleEntry * findTemplate(struct grubConfig * cfg,
> +                                         const char * prefix,
> +                                         int * indexPtr,
> +                                         int skipRemoved,
> +                                         int flags);
> +
> +static int addNewKernel(struct grubConfig * config,
> +                        struct singleEntry * template,
> +                        const char * prefix,
> +                        char * newKernelPath,
> +                        char * newKernelTitle,
> +                        char * newKernelArgs,
> +                        char * newKernelInitrd,
> +                        char ** extraInitrds,
> +                        int extraInitrdCount,
> +                        char * newMBKernel,
> +                        char * newMBKernelArgs);
> +
> +static int checkDeviceBootloader(const char * device,
> +                                 const unsigned char * boot);
> +
> +static int checkForLilo(struct grubConfig * config);
> +static int checkForGrub(struct grubConfig * config);
> +static int checkForGrub2(struct grubConfig * config);
> +static int checkLiloOnRaid(char * mdDev,
> +                           const unsigned char * boot);
> +
> +static void displayEntry(struct singleEntry * entry,
> +                         const char * prefix,
> +                         int index);
> +
> +static int displayInfo(struct grubConfig * config,
> +                       char * kernel,
> +                       const char * prefix);
> +
> +static void dumpSysconfigGrub(void);
> +static int parseSysconfigGrub(int * lbaPtr,
> +                              char ** bootPtr);
> +
>  struct configFileInfo {
>      char * defaultConfig;
>      findConfigFunc findConfig;

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux