View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006743 | GNUnet | file-sharing service | public | 2021-02-06 18:11 | 2022-02-26 23:10 |
Reporter | cy1 | Assigned To | schanzen | ||
Priority | low | Severity | feature | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | Gentoo | OS | Linux | OS Version | 5.9.1 |
Product Version | Git master | ||||
Fixed in Version | 0.16.0 | ||||
Summary | 0006743: anonymous structs in GNUNET_FS_ProgressInfo impede modularity | ||||
Description | I'd like to write myself a dispatcher that delegates to various dispatchers in different modules for each operation, like: ``` static void* progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { switch(info->status) { case GNUNET_FS_STATUS_SEARCH_RESULT: return search_progress(info->value.search); case GNUNET_FS_DOWNLOAD_PROGRESS: return download_progress(info->value.download); ... }; } ``` But since info->value.search is an anonymous struct, there is no way to write the function signature for search_progress, or download_progress, outside of using typeof like: ``` const struct GNUNET_FS_ProgressInfo dummyvariable __attribute__((__unused__)); void* search_progress(const typeof(dummyvariable.value.search) info); ``` I would appreciate it if each of the members of that union could be given names, however ludicrously verbose, so that I could write: ``` void* search_progress(GNUNET_FS_ProgressInfoSearch info); ``` Once I know it's a search event, there's no reason to access value.download or value.publish, so it just prevents me from removing verbosity, and introduces potential for interface boundary failures such as accidentally using code which accesses value.download in a search dispatcher. Anyway it's just a little nitpick I wanted to get reported so that someone with commit access could patch it whenever they get around to it. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2021-02-06 18:11 | cy1 | New Issue | |
2021-02-06 18:11 | cy1 | File Added: named_progress_values.bundle | |
2021-02-21 10:55 | schanzen | Assigned To | => schanzen |
2021-02-21 10:55 | schanzen | Status | new => feedback |
2021-02-21 10:55 | schanzen | Note Added: 0017558 | |
2021-02-21 10:55 | schanzen | Target Version | => 0.14.1 |
2021-04-05 11:25 | schanzen | Target Version | 0.14.1 => 0.14.2 |
2021-06-10 19:37 | schanzen | Target Version | 0.14.2 => 0.15.0 |
2021-06-10 23:01 | schanzen | Target Version | 0.15.0 => |
2022-02-22 23:12 | schanzen | Status | feedback => resolved |
2022-02-22 23:12 | schanzen | Resolution | open => fixed |
2022-02-22 23:12 | schanzen | Fixed in Version | => 0.16.0 |
2022-02-22 23:12 | schanzen | Note Added: 0018712 | |
2022-02-26 23:10 | schanzen | Note Added: 0018723 | |
2022-02-26 23:10 | schanzen | Status | resolved => closed |