gomp-discuss
[Top][All Lists]
Advanced

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

Re: [Gomp-discuss] libgomp.h


From: Pop Sébastian
Subject: Re: [Gomp-discuss] libgomp.h
Date: Wed, 12 Feb 2003 22:02:04 +0100
User-agent: Mutt/1.4i

Hi Scott,

On Wed, Feb 12, 2003 at 02:00:05PM -0500, Scott Robert Ladd wrote:
> Let me know if this looks "good" according to all the relevant standards and
> such.
> 
> ..Scott

> /* Function declarations for libgomp (GNU OpenMP).
> 
>    Copyright 2003 Free Software Foundation, Inc.
>    
>    Note - certain prototypes declared in this header file are for
>    functions whoes implementation copyright does not belong to the
>    FSF.  Those prototypes are present in this file for reference
>    purposes only and their presence in this file should not construed
>    as an indication of ownership by the FSF of the implementation of
>    those functions in any way or form whatsoever.
> 
>    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, 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, write to the Free Software
>    Foundation, Inc., 59 Temple Place - Suite 330,
>    Boston, MA 02111-1307, USA.
> */
> 
> #ifndef LIBGOMP_H
> #define LIBGOMP_H
> 
> #ifdef __cplusplus
> extern "C" {
> #endif
> 
> #ifndef OMP_NEST_LOCK_T
> typedef struct
> {
>     int owner;
>     int count;
> } omp_nest_lock_t;
> #endif
> 
> /*
>     Sets the default number of threads to use for subsequent parallel
>     regions that do not specify a num_threads clause.  */
> extern void omp_set_num_threads(int num_threads)
                                ^^^
Space before '(', no need to name parameters, thus something like the 
following should go...

extern void omp_set_num_threads (int);

> 
> /*  Returns the number of threads currently in the team executing the
>     parallel region from which it is called.    */
                                             ^^^^^
2 spaces exactly between '.' and '*/'


These are just nasty rules we follow (because somebody said that this 
should be this way).  In fact the reason behind is that it is simpler
to grep an expression or automate a processing if the text format 
follows some precise rules... 

In fact I think (I'm not sure) that comments for functions should go 
into .c files instead of .h (except for macros, structs, ...) 
This is because when we use tags [e,c]tags go to the definition of a 
function instead of going to its declaration.  
This makes .h files smaller and simpler to read.
Again we follow these rules because of the size of the project.
(I know, I know Linus is a special case :-)

Thank you for your contribution,
Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]