}
private Pointer init(CopyStruct c) {
- c.cbData = name.length + 1;
+ c.cbData = name.length + 1L;
c.lpData = new Memory(c.cbData);
c.lpData.write(0, name, 0, name.length);
c.lpData.setByte(name.length, (byte) 0);
}
// Don't tiebreak if prefixes are the same, in order to prefer first-parent
// paths.
- return li - ri;
+ return (long) li - ri;
}
private static String simplify(String refName) {
abstract boolean meets(int d, int k, int x, long snake);
final long newSnake(int k, int x) {
- long y = k + x;
+ long y = (long) k + x;
long ret = ((long) x) << 32;
return ret | y;
}
chunks = Collections.unmodifiableList(chunks);
long expectedSize = calculateExpectedSize(chunks);
- long writeCount = 256 + 2 * graphCommits.size()
+ long writeCount = 256L + 2 * graphCommits.size()
+ graphCommits.getExtraEdgeCnt();
monitor.beginTask(
MessageFormat.format(JGitText.get().writingOutCommitGraph,
private void writeChunkLookup(CancellableDigestOutputStream out,
List<ChunkHeader> chunks) throws IOException {
int numChunks = chunks.size();
- long chunkOffset = 8 + (numChunks + 1) * CHUNK_LOOKUP_WIDTH;
+ long chunkOffset = 8 + (numChunks + 1L) * CHUNK_LOOKUP_WIDTH;
byte[] buffer = new byte[CHUNK_LOOKUP_WIDTH];
for (ChunkHeader chunk : chunks) {
NB.encodeInt32(buffer, 0, chunk.id);
@Override
public long getObjectCount() {
- return positions24.size() + positions32.length;
+ return (long) positions24.size() + positions32.length;
}
@Override
* @return estimated size. Approximately {@code 1.75 * sourceLength}.
*/
public static long estimateIndexSize(int sourceLength) {
- return sourceLength + (sourceLength * 3 / 4);
+ return sourceLength + (sourceLength * 3L / 4);
}
/**
this.distantCommitSpan = config.getBitmapDistantCommitSpan();
this.excessiveBranchCount = config.getBitmapExcessiveBranchCount();
long now = SystemReader.getInstance().getCurrentTime();
- long ageInSeconds = config.getBitmapInactiveBranchAgeInDays()
+ long ageInSeconds = (long) config.getBitmapInactiveBranchAgeInDays()
* DAY_IN_SECONDS;
this.inactiveBranchTimestamp = (now / 1000) - ageInSeconds;
}
* @since 3.0
*/
public static long decodeInt64(final byte[] intbuf, final int offset) {
- long r = intbuf[offset] << 8;
+ long r = (long) intbuf[offset] << 8;
r |= intbuf[offset + 1] & 0xff;
r <<= 8;