The R Project SVN R

Rev

Rev 49813 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49813 Rev 53508
Line 44... Line 44...
44
 
44
 
45
	// CRC32 of the Stream Header
45
	// CRC32 of the Stream Header
46
	const uint32_t crc = lzma_crc32(out + sizeof(lzma_header_magic),
46
	const uint32_t crc = lzma_crc32(out + sizeof(lzma_header_magic),
47
			LZMA_STREAM_FLAGS_SIZE, 0);
47
			LZMA_STREAM_FLAGS_SIZE, 0);
48
 
48
 
49
	integer_write_32(out + sizeof(lzma_header_magic)
49
	unaligned_write32le(out + sizeof(lzma_header_magic)
50
			+ LZMA_STREAM_FLAGS_SIZE, crc);
50
			+ LZMA_STREAM_FLAGS_SIZE, crc);
51
 
51
 
52
	return LZMA_OK;
52
	return LZMA_OK;
53
}
53
}
54
 
54
 
Line 64... Line 64...
64
 
64
 
65
	// Backward Size
65
	// Backward Size
66
	if (!is_backward_size_valid(options))
66
	if (!is_backward_size_valid(options))
67
		return LZMA_PROG_ERROR;
67
		return LZMA_PROG_ERROR;
68
 
68
 
69
	integer_write_32(out + 4, options->backward_size / 4 - 1);
69
	unaligned_write32le(out + 4, options->backward_size / 4 - 1);
70
 
70
 
71
	// Stream Flags
71
	// Stream Flags
72
	if (stream_flags_encode(options, out + 2 * 4))
72
	if (stream_flags_encode(options, out + 2 * 4))
73
		return LZMA_PROG_ERROR;
73
		return LZMA_PROG_ERROR;
74
 
74
 
75
	// CRC32
75
	// CRC32
76
	const uint32_t crc = lzma_crc32(
76
	const uint32_t crc = lzma_crc32(
77
			out + 4, 4 + LZMA_STREAM_FLAGS_SIZE, 0);
77
			out + 4, 4 + LZMA_STREAM_FLAGS_SIZE, 0);
78
 
78
 
79
	integer_write_32(out, crc);
79
	unaligned_write32le(out, crc);
80
 
80
 
81
	// Magic
81
	// Magic
82
	memcpy(out + 2 * 4 + LZMA_STREAM_FLAGS_SIZE,
82
	memcpy(out + 2 * 4 + LZMA_STREAM_FLAGS_SIZE,
83
			lzma_footer_magic, sizeof(lzma_footer_magic));
83
			lzma_footer_magic, sizeof(lzma_footer_magic));
84
 
84