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

should use size_t instead of int? #36

Closed
ioquatix opened this issue Jun 12, 2014 · 4 comments
Closed

should use size_t instead of int? #36

ioquatix opened this issue Jun 12, 2014 · 4 comments
Labels

Comments

@ioquatix
Copy link

https://github.com/RainerKuemmerle/g2o/blob/master/g2o/core/sparse_block_matrix.hpp#L216-L221

Proposed fix:

    size_t colM=i;
    const typename SparseBlockMatrix<MatrixFactorType>::SparseMatrixBlock *b=it->second;
    typename SparseBlockMatrix<MatrixType>::IntBlockMap::const_iterator rbt=_blockCols[it->first].begin();
    while(rbt!=_blockCols[it->first].end()){
      //int colA=it->first;
      size_t rowA=rbt->first;

assigning size_t to int truncates the value.

RainerKuemmerle pushed a commit that referenced this issue Jun 15, 2014
As pointed out in #36 there are a lot of other places where implicit
casting to 32bit integer values is happening...
Unfortunately, the g2o API has a lot of int in function declarations.
I'm not sure if explicit casting is the way to go. Maybe we should
clean up the API interface instead...
@ioquatix
Copy link
Author

I'm not sure if this helps, but in my mind, explicit casting is a hack and not a real solution, except in very specific situations.

@ioquatix
Copy link
Author

Any update on this?

@RainerKuemmerle
Copy link
Owner

Not so far. I guess, it's also kind of low priority or do I miss any other
issues (despite compiler warnings).

On Tue, Oct 28, 2014 at 2:16 AM, Samuel Williams [email protected]
wrote:

Any update on this?


Reply to this email directly or view it on GitHub
#36 (comment).

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants