Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all warnings. #162

Merged
merged 21 commits into from
May 11, 2014
Merged

Fix all warnings. #162

merged 21 commits into from
May 11, 2014

Conversation

toots
Copy link
Member

@toots toots commented Mar 28, 2014

No description provided.

@toots toots changed the title WIP: Fix almost all warnings. Fix almost all warnings. Mar 29, 2014
@toots
Copy link
Member Author

toots commented Mar 29, 2014

There are some left-over warnings:

OCAMLOPT -c tools/utils.ml
File "tools/utils.ml", line 245, characters 4-17:
Warning 32: unused value get_backtrace.
....
OCAMLOPT -c configure.ml
File "configure.ml", line 123, characters 4-20:
Warning 32: unused value record_backtrace.

These can go only if we drop some code for OCaml <= 3.11.. I'm in favor of doing it..

@@ -67,7 +67,7 @@ let file_deco filename =
let fill frame =
let pos = Frame.position frame in
let duration = Frame.seconds_of_master (size-pos) in
let rec aux t' =
let rec aux () =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think you need to keep this warning (because it says something useful: this piece of code is unfinished) or do some more modification. It may be okay to get rid of t' because the reference to t is used to keep track of time. I don't know why there is a reference, maybe to use it at the end after aux has returned.. but right now, the last update is useless because the ref is forgotten right after.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what last update you have in mind but after re-reading this code, it looks fine to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the code again. It didn't make sense at first, but now it does, and I believe that my previous comment was misleaded. The reference t keeps track of the time in the metadata stream, and lives through all calls of fill. I don't see any problem with this code. Thanks!

let skip_header f c = read_header f c

let sample w buf pos len=
let sample w buf len=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the specification, it's a bug if pos is not used, it should...

@dbaelde
Copy link
Member

dbaelde commented Mar 31, 2014

@toots would it be difficult to separate trivial stuff from all those changes that we commented on? It'd be nice to get the obvious changes out of the way to discuss the functions that need real fixing.

Also, I'll try to compile the branch on a relatively old OCaml. I believe I have 3.12 on my laptop, which doesn't have a Debian yet. It does not issue as many warnings as 4.0, but we should make sure there's no new syntax in the diff or anything like that.

@toots
Copy link
Member Author

toots commented Mar 31, 2014

@dbaelde yeah, I'll do that later today. I'm all for 3.12 support but I'd like to drop 3.11 support. Is that ok for y'all?

@smimram
Copy link
Member

smimram commented Mar 31, 2014

I'd be fine with 3.12 support only.

@dbaelde
Copy link
Member

dbaelde commented Mar 31, 2014

I'm okay to support only OCaml >=3.12. However, I'd like it if this branch didn't accumulate more changes. Perhaps drop the compatibility code in master and merge back?

By the way I just tested a 3.12 build here and it worked fine.

@toots toots changed the title Fix almost all warnings. Fix all warnings. Apr 2, 2014
@ghost
Copy link

ghost commented Apr 4, 2014

git version, next: make init; make update

File "tools/utils.ml", line 109, characters 18-19:
Warning 27: unused variable c.
File "tools/wav_aiff.ml", line 213, characters 17-20:
Warning 27: unused variable pos.
File "tools/http.ml", line 245, characters 33-36:
Warning 27: unused variable len.
File "sources/playlist.ml", line 546, characters 27-34:
Warning 27: unused variable timeout.
File "tools/harbor.ml", line 449, characters 42-45:
Warning 27: unused variable len.
File "outputs/icecast2.ml", line 122, characters 19-157:
Warning 9: the following labels are not bound in this record pattern:
fill
Either bind these labels explicitly or add '; _' to the pattern.
File "outputs/icecast2.ml", line 131, characters 19-163:
Warning 9: the following labels are not bound in this record pattern:
fill
Either bind these labels explicitly or add '; _' to the pattern.
File "outputs/icecast2.ml", line 140, characters 19-157:
Warning 9: the following labels are not bound in this record pattern:
fill
Either bind these labels explicitly or add '; _' to the pattern.
File "outputs/icecast2.ml", line 213, characters 11-20:
Warning 6: labels were omitted in the application of this function.
File "outputs/icecast2.ml", line 599, characters 21-31:
Warning 6: labels were omitted in the application of this function.
File "outputs/icecast2.ml", line 25, characters 0-11:
Warning 33: unused open Dtools.
File "decoder/metadata_decoder.ml", line 70, characters 16-18:
Warning 27: unused variable t'.
File "decoder/aac_decoder.ml", line 131, characters 22-28:
Warning 27: unused variable length.
File "decoder/aac_decoder.ml", line 245, characters 21-26:
Warning 27: unused variable chans.
File "decoder/aac_decoder.ml", line 257, characters 18-24:
Warning 27: unused variable length.
File "lang/builtins_cry.ml", line 46, characters 11-20:
Warning 6: labels were omitted in the application of this function.
File "lang/builtins_cry.ml", line 23, characters 0-9:
Warning 33: unused open Lang.

@toots
Copy link
Member Author

toots commented Apr 5, 2014

Thanks for the review! Indeed, some optional parts were not enabled locally here. I still haven't tested alsa and pulseaudio... I've fixed the above warnings, except those that need further discussion/coding..

@toots toots closed this Apr 5, 2014
@toots toots reopened this Apr 5, 2014
@toots
Copy link
Member Author

toots commented May 10, 2014

Okay, ready for the final merge!

@toots toots added this to the 1.1.2 milestone May 10, 2014
@toots toots self-assigned this May 10, 2014
@dbaelde
Copy link
Member

dbaelde commented May 11, 2014

Thanks for the work toots, it all looks fine to me!

toots added a commit that referenced this pull request May 11, 2014
@toots toots merged commit 98a6807 into master May 11, 2014
@toots toots deleted the fix-warnings branch May 11, 2014 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants