edbrowse icon indicating copy to clipboard operation
edbrowse copied to clipboard

Minor style-related improvements are made.

Open varikvalefor opened this issue 3 years ago • 6 comments

varikvalefor avatar Aug 26 '21 22:08 varikvalefor

On the whole I like what you are trying to do, but I'm about halfway through the patch and have a few issues.

The switch you wrote in main.c, yes it needs some tlc; you replaced my continue statements with breaks. That changes the flow of the code. If you left them as continue I think it would work.

The switch you put into buffers.c, switch(ftype) { there are no break statements on the cases, so they all fall through to the last assignment. That won't work.

Later in buffers.c, you replace

while(*s)

with

for(; s++; s)

That makes no sense to me. Did you mean

for(; *s; ++s)

I'll continue reading but these jumped out at me.

Karl Dahlke

eklhad avatar Aug 26 '21 23:08 eklhad

The switch you wrote in main.c, yes it needs some tlc; you replaced my continue statements with breaks. That changes the flow of the code. If you left them as continue I think it would work.

VARIK attempted to test the commit in question; if this attempt had succeeded, then this problem probably would have been fixed. However, the C compiler claims that src/url.c is not found, which is correct.

The switch you put into buffers.c, switch(ftype) { there are no break statements on the cases, so they all fall through to the last assignment. That won't work.

A fine point is made. Maybe C should learn from Haskell. ;^)

Did you mean for(; *s; ++s)

A typo is revealed! Luckily, the quoted interpretation is correct. Thanks for asking.

By the way, on a similar but relatively rewrite-intensive note, a decent bit of repetition is found within the source code. Some functions are also very large, occasionally being dozens if not hundreds of lines long, and cannot be understood particularly easily. Consider breaking these functions into relatively small functions.

varikvalefor avatar Aug 27 '21 00:08 varikvalefor

However, the C compiler claims that src/url.c is not found, which is correct.

This is strange to me. Do you have the latest? Some time ago we merged several small sourcefiles into isup.c, so yes url.c is gone, but the latest makefile should not reference it either. git status - do you have a stale makefile or Makefile or GNUmakefile or such lying around? My makefile doesn't reference url.c at all.

Karl Dahlke

eklhad avatar Aug 27 '21 00:08 eklhad

This is strange to me. Do you have the latest? Some time ago we merged several small sourcefiles into isup.c, so yes url.c is gone, but the latest makefile should not reference it either. git status - do you have a stale makefile or Makefile or GNUmakefile or such lying around? My makefile doesn't reference url.c at all. Karl Dahlke

The cmake stuff is broken. As of the creation of this comment, the standard makeworks fine.

varikvalefor avatar Aug 27 '21 00:08 varikvalefor

The cmake stuff is broken.

Yes, sorry. We don't maintain cmake any more, and should really delete it, or have it print out a "not supported" message, to avoid confusion.

Karl Dahlke

eklhad avatar Aug 27 '21 01:08 eklhad

Yes, sorry.

Stop apologising for doing God's work. cmake is crap. ;^)

varikvalefor avatar Aug 27 '21 01:08 varikvalefor