Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-04 Thread karl
Geert Stappers:
> > I don't understand.
>  
> Make a better patch as the previous one.

Not helping me understand.

Regards,
/Karl Hammar




___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-04 Thread karl
Geert Stappers:
...
> fix bug in detect/bsdl
> 
> Save the entity name as part_name if the idcode matches for this file.

Would it be if the first line was dropped ?

Regards,
/Karl Hammar



___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-04 Thread Oops
On Sun, Aug 04, 2019 at 09:58:44AM +0200, Geert Stappers wrote:
> > I don't understand.
>  
> Make a better patch as the previous one.
> 
> And "patch" being the source plus matching commit message.
  And "patch" being the source change plus matching commit message.
> 
> 
> Groeten
> Geert Stappers
> -- 
> Leven en laten leven


___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-04 Thread Geert Stappers
> I don't understand.
 
Make a better patch as the previous one.

And "patch" being the source plus matching commit message.


Groeten
Geert Stappers
-- 
Leven en laten leven


___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-04 Thread Karl Hammar

Geert Stappers:
...
> No. Create commit message that make reading `git show` or `git log --patch` 
> coherent.
> 
> Currently doesn't
> 
> Subject: Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl
> 
> > Save the entity name as part_name ifthe idcode matches for this 
> > file.
> 
> 
> look coherent.  Current commit message without email clutter:
> 
> fix bug in detect/bsdl
> 
> Save the entity name as part_name if the idcode matches for this file.

I don't understand.

Regards,
/Karl Hammar



___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-03 Thread Geert Stappers
On Sat, Aug 03, 2019 at 09:21:28PM +0200, k...@aspodata.se wrote:
> Geert Stappers:
> > On Sat, Aug 03, 2019 at 05:11:38PM +0200, Karl Hammar wrote:
> > >   urj_vhdl_set_entity() saved the entity name in the parts part_name.
> > >   Now that that bug is fixed, save the entity name as part_name if
> > >   the idcode matches for this file.
> ...
> > Rewrite the commit message into what just matches the change
> 
> Would:
> 
>   Save the entity name as part_name ifthe idcode matches for this 
> file.
> 
> be ok ?
> 

No. Create commit message that make reading `git show` or `git log --patch` 
coherent.

Currently doesn't

Subject: Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

>   Save the entity name as part_name ifthe idcode matches for this 
> file.


look coherent.  Current commit message without email clutter:

fix bug in detect/bsdl

Save the entity name as part_name if the idcode matches for this file.





Groeten
Geert Stappers
-- 
Leven en laten leven


___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-03 Thread karl
Geert Stappers:
> On Sat, Aug 03, 2019 at 05:11:38PM +0200, Karl Hammar wrote:
> > urj_vhdl_set_entity() saved the entity name in the parts part_name.
> > Now that that bug is fixed, save the entity name as part_name if
> > the idcode matches for this file.
...
> Rewrite the commit message into what just matches the change from below.

Would:

Save the entity name as part_name ifthe idcode matches for this 
file.

be ok ?

Regards,
/Karl Hammar



___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-03 Thread Geert Stappers
On Sat, Aug 03, 2019 at 05:11:38PM +0200, Karl Hammar wrote:
>   urj_vhdl_set_entity() saved the entity name in the parts part_name.
>   Now that that bug is fixed, save the entity name as part_name if
>   the idcode matches for this file.

That is way too much "copy and paste" from previous "too many unrelated
changes in 1 commit".

Rewrite the commit message into what just matches the change from below.

> ---
>  urjtag/src/bsdl/bsdl.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/urjtag/src/bsdl/bsdl.c b/urjtag/src/bsdl/bsdl.c
> index afb5d635..d81e969e 100644
> --- a/urjtag/src/bsdl/bsdl.c
> +++ b/urjtag/src/bsdl/bsdl.c
> @@ -140,10 +140,13 @@ urj_bsdl_read_file (urj_chain_t *chain, const char 
> *BSDL_File_Name,
>  
>  result = urj_bsdl_process_elements (_ctrl, idcode);
>  
> -if (result >= 0)
> +if (result >= 0) {
> + strncpy(jtag_ctrl.part->part_name, 
> vhdl_parser_priv->entity_name, URJ_PART_PART_MAXLEN);
> + jtag_ctrl.part->part_name[URJ_PART_PART_MAXLEN] = '\0';
>  urj_bsdl_msg (proc_mode,
>_("BSDL file '%s' passed BSDL stage 
> correctly\n"),
>BSDL_File_Name);
> + }
>  
>  }
>  else


Groeten
Geert Stappers
-- 
Leven en laten leven


___
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development


Re: [UrJTAG-dev] [PATCH] fix bug in detect/bsdl

2019-08-03 Thread Geert Stappers


Summary:  split in two commits, probably three commits


On Sat, Aug 03, 2019 at 02:32:10PM +0200, Karl Hammar wrote:
>   urj_vhdl_set_entity() saved the entity name in the parts part_name
>   even though we don't know at that stage if the idcode matches for
>   this file.

Is for commit "A".


 
>   Hunting this bug down, I found too many things are called part, so
>   part of this is to change part->part to part->part_name, ditto for
>   manufaturer to make it easier to find the offender.

Is for commit "B"
Proposal for new long commit message for commit B
 
|   Too many things are called part, so
|   part of this is to change part->part to part->part_name, ditto for
|   manufaturer to make it easier to find the offender.

> ---
>  urjtag/include/urjtag/part.h | 4 ++--
>  urjtag/src/bfin/bfin.c   | 2 +-
>  urjtag/src/bsdl/bsdl.c   | 5 -
>  urjtag/src/bsdl/bsdl_types.h | 2 ++
>  urjtag/src/bsdl/vhdl_bison.y | 5 ++---
>  urjtag/src/part/part.c   | 6 +++---
>  urjtag/src/tap/detect.c  | 8 
>  7 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/urjtag/include/urjtag/part.h b/urjtag/include/urjtag/part.h
> index f0cddbc7..50ce74df 100644
> --- a/urjtag/include/urjtag/part.h
> +++ b/urjtag/include/urjtag/part.h
> @@ -42,8 +42,8 @@ struct URJ_PART
>  {
>  urj_tap_register_t *id;
>  char *alias;/* djf refdes */
> -char manufacturer[URJ_PART_MANUFACTURER_MAXLEN + 1];
> -char part[URJ_PART_PART_MAXLEN + 1];
> +char manufacturer_name[URJ_PART_MANUFACTURER_MAXLEN + 1];
> +char part_name[URJ_PART_PART_MAXLEN + 1];
>  char stepping[URJ_PART_STEPPING_MAXLEN + 1];
>  urj_part_signal_t *signals;
>  urj_part_salias_t *saliases;

B

> diff --git a/urjtag/src/bfin/bfin.c b/urjtag/src/bfin/bfin.c
> index dd4bd3b2..d7c9d39d 100644
> --- a/urjtag/src/bfin/bfin.c
> +++ b/urjtag/src/bfin/bfin.c
> @@ -131,7 +131,7 @@ part_scan_select (urj_chain_t *chain, int n, int scan)
>  if (part->active_instruction == NULL)
>  {
>  urj_log (URJ_LOG_LEVEL_ERROR,
> - _("%s: unknown instruction '%s'\n"), part->part, 
> scans[scan]);
> + _("%s: unknown instruction '%s'\n"), part->part_name, 
> scans[scan]);
>  return -1;
>  }
>  

B

> diff --git a/urjtag/src/bsdl/bsdl.c b/urjtag/src/bsdl/bsdl.c
> index afb5d635..d81e969e 100644
> --- a/urjtag/src/bsdl/bsdl.c
> +++ b/urjtag/src/bsdl/bsdl.c
> @@ -140,10 +140,13 @@ urj_bsdl_read_file (urj_chain_t *chain, const char 
> *BSDL_File_Name,
>  
>  result = urj_bsdl_process_elements (_ctrl, idcode);
>  
> -if (result >= 0)
> +if (result >= 0) {
> + strncpy(jtag_ctrl.part->part_name, 
> vhdl_parser_priv->entity_name, URJ_PART_PART_MAXLEN);
> + jtag_ctrl.part->part_name[URJ_PART_PART_MAXLEN] = '\0';
>  urj_bsdl_msg (proc_mode,
>_("BSDL file '%s' passed BSDL stage 
> correctly\n"),
>BSDL_File_Name);
> + }
>  
>  }
>  else

C

> diff --git a/urjtag/src/bsdl/bsdl_types.h b/urjtag/src/bsdl/bsdl_types.h
> index d19ffd11..efe09579 100644
> --- a/urjtag/src/bsdl/bsdl_types.h
> +++ b/urjtag/src/bsdl/bsdl_types.h
> @@ -157,10 +157,12 @@ typedef struct jtag_ctrl urj_bsdl_jtag_ctrl_t;
>  
>  /* private data of the VHDL bison parser
> used to store variables the would end up as globals otherwise */
> +#define VHDL_PARSER_ENTITY_NAME_MAXLEN20
>  struct vhdl_parser_priv
>  {
>  char Package_File_Name[100];
>  int Reading_Package;
> +char entity_name[VHDL_PARSER_ENTITY_NAME_MAXLEN+1];
>  char *buffer;
>  size_t len_buffer;
>  void *scanner;

A

> diff --git a/urjtag/src/bsdl/vhdl_bison.y b/urjtag/src/bsdl/vhdl_bison.y
> index 4030b3b4..4d057df5 100644
> --- a/urjtag/src/bsdl/vhdl_bison.y
> +++ b/urjtag/src/bsdl/vhdl_bison.y
> @@ -918,9 +918,8 @@ urj_vhdl_set_entity (urj_vhdl_parser_priv_t *priv, char 
> *entityname)
>  {
>  if (priv->jtag_ctrl->proc_mode & URJ_BSDL_MODE_INSTR_EXEC)
>  {
> -strncpy (priv->jtag_ctrl->part->part, entityname,
> - URJ_PART_PART_MAXLEN);
> -priv->jtag_ctrl->part->part[URJ_PART_PART_MAXLEN] = '\0';
> +strncpy (priv->entity_name, entityname, 
> VHDL_PARSER_ENTITY_NAME_MAXLEN);
> +priv->entity_name[VHDL_PARSER_ENTITY_NAME_MAXLEN] = '\0';
>  }
>  
>  free (entityname);

A

> diff --git a/urjtag/src/part/part.c b/urjtag/src/part/part.c
> index b7297a05..f5c4dbd0 100644
> --- a/urjtag/src/part/part.c
> +++ b/urjtag/src/part/part.c
> @@ -52,8 +52,8 @@ urj_part_alloc (const urj_tap_register_t *id)
>  p->alias = NULL;/* djf */
>  /*  RFHH check result */
>  p->id = urj_tap_register_duplicate (id);
> -p->manufacturer[0] = '\0';
> -p->part[0] = '\0';
> +p->manufacturer_name[0] = '\0';
> +p->part_name[0] =