[ 
https://issues.apache.org/jira/browse/LUCY-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15303419#comment-15303419
 ] 

ASF GitHub Bot commented on LUCY-295:
-------------------------------------

GitHub user rectang opened a pull request:

    https://github.com/apache/lucy/pull/49

    LUCY-295 Misc int type fixes, part 2

    Misc int type fixes for -Wconversion, part 2.
    
    *   frequencies (term freq, doc freq)
    *   doc counts
    *   pointer math results
    *   change return type of Sim_Encode_Norm to uint8_t
    *   grab bag of other fixes
    
    The only remaining -Wconversion warnings from core/ after this branch gets
    merged are in BitVec_Next_Hit, which is arguably buggy.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rectang/lucy LUCY-295-misc2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucy/pull/49.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #49
    
----
commit 48a4d185fc3570c7336dae884f8343377e31608e
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T01:09:40Z

    Cast some freq values.
    
    Perform some harmless sign casts for integers containing frequency
    counts (term freq, doc freq).

commit b341575bd4867f87f704f931214d2797912df540
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T01:13:52Z

    Make float-not-zero check explicit.

commit a94f500f219160a944cb8523ae6be6902d75147e
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T01:49:30Z

    Harmless sign casts for position/count vars.

commit 4792d3e842920c2b101ec160164f256ac23ba498
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:00:53Z

    Cast pointer math results.
    
    All instances are not expected to overflow and would not result in
    tragedy in the extremely unlikely event that overflow does happen.

commit 1be7e72ed55cb939f42c6e71ccec7e2337d550d1
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:09:15Z

    Cast buf counts in SortExternal and PostingPool.

commit fe29dae681d18c3472f33e04c23fdc970341c52f
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:22:18Z

    Guard against overflow.
    
    The return value of Compare only need be positive/negative/0 -- the
    magnitude doesn't matter.

commit 72fd9af8ba351fd9a6450dfffb4189095c2d4b26
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:28:40Z

    Change return type of Encode_Norm to uint8_t.
    
    Encode_Norm is expected to implement a single-byte encoding.

commit 6a7ce0a3d1b321c30c088f1b8d6c748675b21909
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:38:27Z

    Harmless casts of file positions.

commit 94b48ca6a9713438b284e70d212acfcee96e6811
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:47:42Z

    Change width of test-only var.

commit f6a4e0af445e80b839b86f47de1fdc3dca833fba
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T02:56:50Z

    Settle on uint32_t for mem thresh.
    
    The memory threshold which triggers a flush could be a size_t but
    doesn't need to be and it's less work to settle on uint32_t.

commit 06c0800442c90a86702160b10ec9896e8e473694
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:00:45Z

    Harmless casts in SortFieldWriter.

commit 9b7e53fef47f613ac0240c12cdd37d448ad32802
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:02:42Z

    Internal int type change.
    
    Values are constrained to a closed set, all positive.

commit 25747a2397193882595667b4cba0a6d42658669d
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:05:12Z

    Harmless sign cast in Lock.

commit b5ad0f223343cee8e554438ce49693efa3bc1646
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:08:53Z

    Harmless cast (doc count shouldn't be negative).

commit bca2a204a9c09ef34a4dc3baba5d46bb147cc100
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:18:23Z

    Fix harmless type glitch in BitVector.

commit 110cfc2bb216605cd356196dd5eefd18c819bd74
Author: Marvin Humphrey <[email protected]>
Date:   2016-05-27T03:22:04Z

    Harmless int type fixes in SortCollector.

----


> Address integer conversion compiler warnings
> --------------------------------------------
>
>                 Key: LUCY-295
>                 URL: https://issues.apache.org/jira/browse/LUCY-295
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>             Fix For: 0.6.0
>
>
> Enabling `-Wconversion` reveals a fairly large number of warnings.  Most are 
> harmless and just require an inconsequential type change or a cast.  Some are 
> best fixed with API changes. There may be some bugs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to