The GNU Hurd - Patches: patch #3330, HURD_IHASH_ITERATE_KEYS
You are not allowed to post comments on this tracker with your current authentication level.
patch #3330: HURD_IHASH_ITERATE_KEYS
Submitter: | Ognyan Kulev <ogi> | ||
Submitted: | Wed 01 Sep 2004 07:18:54 AM UTC | ||
Category: | libihash | Priority: | 3 - Low |
Status: | None | Privacy: | Public |
Assigned to: | marcus | Open/Closed: | Open |
Planned Release: | None | ||
Wiki-like text discussion box: |
|
Mon 08 Nov 2004 04:08:43 PM UTC, comment #5: |
Marcus Brinkmann <marcus>![]() ![]() |
Wed 01 Sep 2004 01:28:24 PM UTC, comment #4: I don't need such macro for the ext2fs patch. But I needed one for ext3fs. Fortunately, in my case, I could retrieve key from value.
|
Ognyan Kulev <ogi>![]() |
Wed 01 Sep 2004 01:17:14 PM UTC, comment #3: Marcus, a single macro (which provides both the key and the value)
|
Neal H. Walfield <neal>![]() |
Wed 01 Sep 2004 12:19:54 PM UTC, comment #2: Ogi, do you actually need this in your code?
|
Marcus Brinkmann <marcus>![]() ![]() |
Wed 01 Sep 2004 10:57:31 AM UTC, comment #1: I agree this function is useful, however, I think the patch is
|
Neal H. Walfield <neal>![]() |
Wed 01 Sep 2004 07:18:54 AM UTC, original submission:
New for loop that loops only once is used. Its purpose is to define key as hurd_ihash_key_t.
|
Ognyan Kulev <ogi>![]() |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
To Neal, the current form exists because most of the time you don't need the variable outside of the scope, and you can always achieve what you want with something like { outside_val = val; break; } in your code.
OTOH, I see your and Ogi's point. Macro tricks are not particularly readable either, so defining them outside of the macro is actually something that is more natural. I am starting to waiver.
This would call for a new patch, with only one macro, not two, that takes the name of already defined key and value variables, and just uses those. This would also make the for loop much simpler, I guess, and remove all my terribly clever but not at all too readable hacks from this macro.
All callers need to be changed, too.