public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: "Matthew McCormick (thewtex)" <matt@mmmccormick.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: archer@sourceware.org
Subject: Re: [PATCH 1/2] [python] Add gdb.value_history_count()
Date: Thu, 17 Dec 2009 14:34:00 -0000	[thread overview]
Message-ID: <f23d1cbc0912170634i7c8c9e5cy5f960c3312c58540@mail.gmail.com> (raw)
In-Reply-To: <4B29F2FF.8090408@redhat.com>

On Thu, Dec 17, 2009 at 2:59 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
> On 12/15/2009 05:54 AM, Matt McCormick (thewtex) wrote:
>
> On the whole this looks ok: a few nits from me.  This is not an
> official review though, Tom will have to look at it.
>
>
>> 2009-12-14  Matt McCormick  <matt@mmmccormick.com>
>>
>>       * gdb/python/py-value.c (gdbpy_value_history_count): Implement
>>       gdb.value_history_count()
>>       * gdb/python/python-internal.h (thread_object): Python extension
>>       definition.
>>       * gdb/python/python.c (GdbMethods): Register in module methods.
>>       * gdb/value.c (get_value_history_count): New Function.
>>       * gdb/value.h (get_value_history_count): New Function.
>
>
> The paths here seem wrong.  For items in the python directory, the
> entries belong in the ChangeLog in the src/gdb directory.  It should
> read:
>
>
> 2009-12-14  Matt McCormick  <matt@mmmccormick.com>
>
>        * python/py-value.c (gdbpy_value_history_count): Implement
>        gdb.value_history_count()
>
> and so on for all ChangeLog entries.
>
>
>> +/* Implementation of gdb.value_history_count. */
>
>
> For FSF C style, two spaces after the period, please.
>
>
>> +PyObject *
>> +gdbpy_value_history_count (PyObject *self, PyObject *args)
>> +{
>> +  return Py_BuildValue("i", get_value_history_count());
>> +}
>
>
> Similarly a space before '(' in a function.  So:
>
>
>> +  return Py_BuildValue ("i", get_value_history_count ());
>
>
> While there is nothing wrong with Py_BuildValue, if it is certain that
> the value is a long or an int, why not use PyLong_AsLong or PyInt_AsLong?
> I'm purely curious.
>
>
>>  /* Accessor methods.  */
>>
>> +int
>> +get_value_history_count()
>> +{
>> +  return value_history_count;
>> +}
>> +
>
>
> Space after '('.
>
>
>>
>> +/* Abs number of last entry stored */
>> +
>> +int get_value_history_count();
>> +
>
> Comments need to be full sentences, with a period.  Two spaces at the
> end please. ;)
>
> Even though this is pretty straight-forward, when I add any
> functionality accessible to the user via the API, I like to add a test
> to demonstrate it works.  This also helps catch regressions in the
> future.  This should be pretty simple to code up. What do you think?
>
> Cheers,
>
> Phil
>

Thank you very much for the comments.  I'll make the changes and
submit an update.

  reply	other threads:[~2009-12-17 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 21:22 Matt McCormick (thewtex)
2009-12-13 21:22 ` [PATCH 2/2] [python] Document gdb.value_history_count() Matt McCormick (thewtex)
2009-12-15  5:51   ` Matthew McCormick (thewtex)
2009-12-15  5:55     ` [PATCH 1/2] [python] Add gdb.value_history_count() Matt McCormick (thewtex)
2009-12-15  5:55       ` [PATCH 2/2] [python] Document gdb.value_history_count Matt McCormick (thewtex)
     [not found]         ` <4B29F581.1020601@redhat.com>
2009-12-17  9:13           ` Phil Muldoon
2009-12-17  8:59       ` [PATCH 1/2] [python] Add gdb.value_history_count() Phil Muldoon
2009-12-17 14:34         ` Matthew McCormick (thewtex) [this message]
2009-12-30 17:06         ` Matthew McCormick (thewtex)
2009-12-30 17:09           ` [PATCH] " Matt McCormick
2009-12-30 17:17             ` Matt McCormick
2010-01-05 14:51               ` Phil Muldoon
2010-01-05 19:49                 ` Tom Tromey
2010-01-06  5:10                 ` Matthew McCormick (thewtex)
2010-01-06  5:11                   ` Matt McCormick
2010-01-17 19:40                     ` Matt McCormick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f23d1cbc0912170634i7c8c9e5cy5f960c3312c58540@mail.gmail.com \
    --to=matt@mmmccormick.com \
    --cc=archer@sourceware.org \
    --cc=pmuldoon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).