w3m icon indicating copy to clipboard operation
w3m copied to clipboard

Cleanup some code

Open rkta opened this issue 1 year ago • 2 comments

Removing most (all?) dead code (commented out, ifdef 0'd, etc) and removing and fixing various smaller things.

It's a draft for now as it needs some adjustment once the other PRs are merged and I don't want to overwhelm tats. :-) I just carry this patches long enough that and had no issues. Making them public so others can review and don't do the same work.

rkta avatar Aug 11 '23 09:08 rkta

On Fri, Aug 11, 2023 at 10:05:25AM -0700, NRK wrote:

@N-R-K commented on this pull request. (and maybe look into using memmove instead, since bcopy is depreciated)

Good point, would fit the PR's topic.

@@ -1020,7 +1020,7 @@ find_auth_pass_entry(char *host, int port, char *realm, char *uname,

int find_auth_user_passwd(ParsedURL *pu, char *realm,

  •       Str *uname, Str *pwd, int is_proxy)
    
  •       volatile Str *uname, volatile Str *pwd, int is_proxy)
    

Any code using volatile is pretty suspicious and should be subject for scrutiny. I'd rather not add more of them.

It is suspicious. I removed all volatile from the code - and it stopped working. :-)

This change is mainly to fix warnings from -Wcast-qual.

@@ -7,6 +7,10 @@ extern int LINES, COLS; extern int LASTLINE; #endif

+void clear(void); +void flush_tty();

This removes void in the argument list changing the semantics. Same with mouse_end.

Sorry, about this. I reordered the patches. As you said it's fixed in a later commit - bad style from my side, though. Will review them again.

rkta avatar Aug 11 '23 18:08 rkta

On Fri, Aug 11, 2023 at 08:01:27PM +0200, Rene Kita wrote:

On Fri, Aug 11, 2023 at 10:05:25AM -0700, NRK wrote:

@N-R-K commented on this pull request. (and maybe look into using memmove instead, since bcopy is depreciated)

Good point, would fit the PR's topic.

Back to the backlog ;)

While replacing bcopy with memmove is easy, it needs changes to configure.ac but autoreconf errors out. My autohell skills are lacking.

This has to wait until I have time or someone else updates our autotools stuff.

rkta avatar Aug 11 '23 18:08 rkta