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

Pointer.copyTo() - elementCount #317

Closed
operutka opened this Issue Jun 7, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@operutka

operutka commented Jun 7, 2012

I would expect this method:

public void copyTo(Pointer<?> destination, long elementCount) {
PointerIO io = getIO("Cannot copy untyped pointer without byte count information. Please use copyTo(offset, destination, destinationOffset, byteCount) instead");
copyBytesAtOffsetTo(0, destination, 0, getValidElements() * io.getTargetSize());
}

to be something like this:

public void copyTo(Pointer<?> destination, long elementCount) {
PointerIO io = getIO("Cannot copy untyped pointer without byte count information. Please use copyTo(offset, destination, destinationOffset, byteCount) instead");
copyBytesAtOffsetTo(0, destination, 0, elementCount * io.getTargetSize());
}

Although there is a parameter called elementCount in the original method, the parameter is never used. Instead of this parameter there is a call for the getValidElements() method.

It is present in the Git master and also in the 0.6.1 version.

@ochafik

This comment has been minimized.

Show comment
Hide comment
@ochafik

ochafik Jun 7, 2012

Member

Hi @DaemonXY ,

Nice catch, thanks for reporting this bug !
Will update asap.

Cheers

Member

ochafik commented Jun 7, 2012

Hi @DaemonXY ,

Nice catch, thanks for reporting this bug !
Will update asap.

Cheers

@ochafik

This comment has been minimized.

Show comment
Hide comment
@ochafik

ochafik Jun 7, 2012

Member

This is fixed and deployed in the latest 0.6.2-SNAPSHOT (cf. https://code.google.com/p/bridj/wiki/Download#Direct_downloads ).

Thanks again for your report.

Cheers

Member

ochafik commented Jun 7, 2012

This is fixed and deployed in the latest 0.6.2-SNAPSHOT (cf. https://code.google.com/p/bridj/wiki/Download#Direct_downloads ).

Thanks again for your report.

Cheers

@ochafik ochafik closed this Jun 7, 2012

@operutka

This comment has been minimized.

Show comment
Hide comment
@operutka

operutka Jun 7, 2012

Thanks for your fast reaction ;-) ...

operutka commented Jun 7, 2012

Thanks for your fast reaction ;-) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment