Bug 4037 - Fix some small issues
Summary: Fix some small issues
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.17.0
Hardware: PC All
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2018-06-12 16:16 UTC by Avinash Sonawane
Modified: 2019-01-03 20:04 UTC (History)
0 users

See Also:


Attachments
Patch fixing some small issues (12.21 KB, patch)
2018-06-12 16:16 UTC, Avinash Sonawane
no flags Details | Diff

Description Avinash Sonawane 2018-06-12 16:16:55 UTC
Created attachment 1883 [details]
Patch fixing some small issues

Hello!

This patch tries to fix some small issues like removing redundant functions, declaring and using variables only when it's necessary etc.

Please let me know if something needs to be fixed/amended.

Thanks!
Comment 1 wwp 2018-06-12 16:35:18 UTC
About:

-	{"recvtype", A_POP3,
+	{"recvtype", (gchar *)A_POP3,

in wizard.c, that looks wrong to me, since it's a P_INT and not a P_STRING (see line above in source file). Your local change must have raised a warning about it, BTW.
Comment 2 Avinash Sonawane 2018-06-12 16:51:50 UTC
The type of second element of struct PrefParam is gchar * and A_POP3 is the second element.
Comment 3 wwp 2018-06-12 17:05:37 UTC
Oh yes, you're definitely right. We're playing some kind of weird game storing an int as a pointer there, we should itoa() the value into a string and vice-versa when reading, IOW serialize the data correctly (and manage the migration for configurations where it's been stored the old way).
Comment 4 Avinash Sonawane 2018-06-12 17:12:30 UTC
Current code works just because A_POP3 is the first element of 0-based enum. If any change is made to enum RecvProtocol which makes A_POP3 != 0 then that's a recipe for SegFault.

Honestly, current arrangement isn't quite ideal for extending the receive protocols.
Comment 5 Michael Rasmussen 2018-06-12 17:23:20 UTC
(In reply to comment #4)
> Current code works just because A_POP3 is the first element of 0-based enum.
> If any change is made to enum RecvProtocol which makes A_POP3 != 0 then
> that's a recipe for SegFault.
> 
> Honestly, current arrangement isn't quite ideal for extending the receive
> protocols.

Please open a bug in bugzilla for this.
Comment 6 Avinash Sonawane 2018-06-13 09:43:04 UTC
> Please open a bug in bugzilla for this.

Done. https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4038
Comment 7 users 2019-01-03 19:59:03 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2019-01-03 19:59:02.845017455 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=d42cdc00af96f0ba034e6e205216cf4e3c1c7540
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Thu Jan 3 19:48:58 2019 +0100

    Fix return type for vcal_manager_get_cutype_for_attendee()
    
    Patch by Avinash Sonawane, bug #4037.
Comment 8 Andrej Kacian 2019-01-03 20:04:19 UTC
I have applied what parts of your patch which were still relevant. Some things have already been fixed (unused functions), others, like the mailimf.c change, or the changes related to GENERIC_UMPC, I did not consider worth committing.

As GENERIC_UMPC, that build option hasn't worked for quite a while, we are probably (hopefully) going to remove it soon.

Thanks for your patch, and sorry it took a while to get to it.

Note You need to log in before you can comment on or make changes to this bug.