[pacman-dev] [PATCH 00/25] Rename types from pmfoo_t to alpm_foo_t

Sebastian Nowicki sebnow at gmail.com
Sat Jul 9 10:51:42 EDT 2011


Not sure which is the official source, but here's one:
http://www.gnu.org/s/hello/manual/libc/Reserved-Names.html

Extract:

> Some additional classes of identifier names are reserved for future
> extensions to the C language or the POSIX.1 environment. While
> using these names for your own purposes right now might not cause
> a problem, they do raise the possibility of conflict with future versions
> of the C or POSIX standards, so you should avoid these names.
> [..]
> Names that end with ‘_t’ are reserved for additional type names.



On Sat, Jul 9, 2011 at 4:36 AM, Dan McGee <dpmcgee at gmail.com> wrote:
> On Thursday, July 7, 2011, Sebastian Nowicki <sebnow at gmail.com> wrote:
>> This probably won't change considering it's ubiquitous and
>> insignificant, but since we're on the subject, the "_t" suffix is
>> reserved in ISO C (or is it POSIX?). Considering the "alpm_" prefix is
>> used it should be safe. If the suffix were to be removed might want to
>> get rid of the typedefs (i.e. use "struct alpm_pkg" not "alpm_pkg_t").
>>
>> Not really suggesting it, just thought I'd mention it.
>
> Can you find a source for this? I feel like most typedefs, whether in
> system code or user code, use the _t suffix in C code I've seen.
>
>> On Tue, Jun 28, 2011 at 9:19 PM, Dan McGee <dpmcgee at gmail.com> wrote:
>>> On Tue, Jun 28, 2011 at 8:19 AM, Allan McRae <allan at archlinux.org> wrote:
>>>> On 28/06/11 22:32, Allan McRae wrote:
>>>>>
>>>>> On 28/06/11 22:17, Dan McGee wrote:
>>>>>>
>>>>>> On Tue, Jun 28, 2011 at 12:23 AM, Allan McRae<allan at archlinux.org> wrote:
>>>>>>>
>>>>>>> After discussion here and on IRC, it was decided that rather than
>>>>>>> changing the one struct from alpm_foo_t to pmfoo_t for consistency,
>>>>>>> it would instead be better to rename all the other structs to follow
>>>>>>> the alpm_foo_t scheme. Given we are pushing towards 4.0, now is the
>>>>>>> best (only?) time to do this.
>>>>>>>
>>>>>>> I am not going to send the enitre patchset here as that would just be
>>>>>>> overkill. Take a look at the patches in my repo:
>>>>>>> http://projects.archlinux.org/users/allan/pacman.git/log/?h=breakshit
>>>>>>
>>>>>> Two observations:
>>>>>> 1. Where is pmpkg_t?
>>>>>
>>>>> In with pmtrans_t for some reason... will fix!
>>>>>
>>>>>> 2. Does anyone else find "grp" kind of silly? pkg is ubiquitous and at
>>>>>> least less than 50% of the length of package, but I might propose
>>>>>> shifting the type name to "alpm_group_t".
>>>>>
>>>>> Seems reasonable to me. I can adjust this.
>>>>>
>>>>
>>>> Do we want function names with "grp" in them to be changed too? e.g.
>>>> alpm_option_add_ignoregrp, alpm_db_readgrp, alpm_db_get_grpcache, etc...
>>>>  That can come in a separate patchset.
>>>
>>> Yeah, I forgot to bring that into the discussion- 100% agree with just
>>> a subsequent patch adjusting these names. Not sure if you want them to
>>> be like 'ignoregroup' or 'ignore_group', 'groupcache' or
>>> 'group_cache', etc.
>>>
>>> -Dan
>>>
>>>
>>
>>
>
>


More information about the pacman-dev mailing list