Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit :
 * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h.

Why?  It's not used anywhere else.

 ---
  ddb/db_cond.c | 7 ---
  ddb/db_cond.h | 7 +++
  2 files changed, 7 insertions(+), 7 deletions(-)
 
 diff --git a/ddb/db_cond.c b/ddb/db_cond.c
 index 82ec0d6..b8e661b 100644
 --- a/ddb/db_cond.c
 +++ b/ddb/db_cond.c
 @@ -38,14 +38,7 @@
  
  #include kern/debug.h
  
 -
 -#define DB_MAX_COND  10  /* maximum conditions to be set */
 -
  int   db_ncond_free = DB_MAX_COND;   /* free condition */
 -struct db_cond {
 - int c_size; /* size of cond */
 - charc_cond_cmd[DB_LEX_LINE_SIZE];   /* cond  cmd */
 -} db_cond[DB_MAX_COND];
  
  void
  db_cond_free(bkpt)
 diff --git a/ddb/db_cond.h b/ddb/db_cond.h
 index dec4967..161a0d9 100644
 --- a/ddb/db_cond.h
 +++ b/ddb/db_cond.h
 @@ -24,6 +24,13 @@
  #include sys/types.h
  #include machine/db_machdep.h
  
 +#define DB_MAX_COND  10  /* maximum conditions to be set */
 +
 +struct db_cond {
 + int c_size; /* size of cond */
 + charc_cond_cmd[DB_LEX_LINE_SIZE];   /* cond  cmd */
 +} db_cond[DB_MAX_COND];
 +
  extern void db_cond_free (db_thread_breakpoint_t bkpt);
  
  extern boolean_t db_cond_check (db_thread_breakpoint_t bkpt);
 -- 
 1.8.1.4
 
 

-- 
Samuel
I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs...It was very silly.
(By Matt Welsh)



Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Marin Ramesa
On 08.12.2013 15:28:06, Samuel Thibault wrote:
 Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit :
  * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h.
 
 Why?  It's not used anywhere else.

I just tought it looks better this way. Guess I'm not used to seeing 
struct definitions in .c files mixed with function definitions.





Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 16:00:29 +0100, a écrit :
 On 08.12.2013 15:28:06, Samuel Thibault wrote:
  Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit :
   * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h.
  
  Why?  It's not used anywhere else.
 
 I just tought it looks better this way.

Well, on the contrary: if the structure is used only in the file, it's
no used to put it in the interface, and thus the reader wondering what
it would be useful for outside the file.

Samuel