Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Fix possible 32 bit issues. In practice hard to reach but be...
details: https://anonhg.NetBSD.org/src/rev/7db9120f6c80
branches: trunk
changeset: 789159:7db9120f6c80
user: reinoud <reinoud%NetBSD.org@localhost>
date: Fri Aug 09 15:11:08 2013 +0000
description:
Fix possible 32 bit issues. In practice hard to reach but better be safe than
sorry.
diffstat:
sbin/newfs_udf/newfs_udf.c | 10 +++++-----
sbin/newfs_udf/newfs_udf.h | 2 +-
sbin/newfs_udf/udf_create.h | 8 ++++----
usr.sbin/makefs/udf.c | 14 +++++++-------
4 files changed, 17 insertions(+), 17 deletions(-)
diffs (137 lines):
diff -r 8f759309fb1e -r 7db9120f6c80 sbin/newfs_udf/newfs_udf.c
--- a/sbin/newfs_udf/newfs_udf.c Fri Aug 09 12:56:31 2013 +0000
+++ b/sbin/newfs_udf/newfs_udf.c Fri Aug 09 15:11:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs_udf.c,v 1.17 2013/08/06 13:15:30 reinoud Exp $ */
+/* $NetBSD: newfs_udf.c,v 1.18 2013/08/09 15:11:08 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -75,7 +75,7 @@
/* queue for temporary storage of sectors to be written out */
struct wrsect {
- uint32_t sectornr;
+ uint64_t sectornr;
uint8_t *sector_data;
TAILQ_ENTRY(wrsect) next;
};
@@ -108,7 +108,7 @@
*/
int
-udf_write_sector(void *sector, uint32_t location)
+udf_write_sector(void *sector, uint64_t location)
{
struct wrsect *pos, *seekpos;
@@ -155,8 +155,8 @@
{
struct wrsect *pos;
uint64_t offset;
- uint32_t line_len, line_offset;
- uint32_t line_start, new_line_start, relpos;
+ uint64_t line_start, new_line_start;
+ uint32_t line_len, line_offset, relpos;
uint32_t blockingnr;
uint8_t *linebuf, *adr;
diff -r 8f759309fb1e -r 7db9120f6c80 sbin/newfs_udf/newfs_udf.h
--- a/sbin/newfs_udf/newfs_udf.h Fri Aug 09 12:56:31 2013 +0000
+++ b/sbin/newfs_udf/newfs_udf.h Fri Aug 09 15:11:08 2013 +0000
@@ -57,7 +57,7 @@
struct udf_disclayout layout;
/* prototypes */
-int udf_write_sector(void *sector, uint32_t location);
+int udf_write_sector(void *sector, uint64_t location);
int udf_update_trackinfo(struct mmc_discinfo *di, struct mmc_trackinfo *ti);
/* tmp */
diff -r 8f759309fb1e -r 7db9120f6c80 sbin/newfs_udf/udf_create.h
--- a/sbin/newfs_udf/udf_create.h Fri Aug 09 12:56:31 2013 +0000
+++ b/sbin/newfs_udf/udf_create.h Fri Aug 09 15:11:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_create.h,v 1.6 2013/08/06 12:49:13 reinoud Exp $ */
+/* $NetBSD: udf_create.h,v 1.7 2013/08/09 15:11:08 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -83,10 +83,10 @@
/* handys */
#define UDF_ROUNDUP(val, gran) \
- ((gran) * (((uint64_t)(val) + (gran)-1) / (gran)))
+ ((uint64_t) (gran) * (((uint64_t)(val) + (gran)-1) / (gran)))
#define UDF_ROUNDDOWN(val, gran) \
- ((gran) * (((uint64_t)(val)) / (gran)))
+ ((uint64_t) (gran) * (((uint64_t)(val)) / (gran)))
/* disc offsets for various structures and their sizes */
@@ -182,7 +182,7 @@
/* logical to physical translations */
int vtop[UDF_PMAPS+1]; /* vpartnr trans */
int vtop_tp[UDF_PMAPS+1]; /* type of trans */
- int vtop_offset[UDF_PMAPS+1]; /* offset in lb */
+ uint64_t vtop_offset[UDF_PMAPS+1]; /* offset in lb */
/* sparable */
struct udf_sparing_table*sparing_table; /* replacements */
diff -r 8f759309fb1e -r 7db9120f6c80 usr.sbin/makefs/udf.c
--- a/usr.sbin/makefs/udf.c Fri Aug 09 12:56:31 2013 +0000
+++ b/usr.sbin/makefs/udf.c Fri Aug 09 15:11:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.11 2013/08/09 11:29:44 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.12 2013/08/09 15:11:08 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: udf.c,v 1.11 2013/08/09 11:29:44 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.12 2013/08/09 15:11:08 reinoud Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -90,7 +90,7 @@
/* --------------------------------------------------------------------- */
int
-udf_write_sector(void *sector, uint32_t location)
+udf_write_sector(void *sector, uint64_t location)
{
uint64_t wpos;
ssize_t ret;
@@ -635,8 +635,8 @@
uint64_t inf_len, obj_size, logblks_rec;
uint32_t l_ea, l_ad, size;
uint32_t last_lb_num, piece_lb_num;
- uint32_t last_len, piece_len, last_flags;
- uint32_t rest_len, merge_len, last_end;
+ uint64_t last_len, piece_len, last_flags;
+ uint64_t rest_len, merge_len, last_end;
uint16_t last_part_num, piece_part_num;
uint16_t crclen, cur_alloc;
uint8_t *data, *pos;
@@ -710,7 +710,7 @@
/* try merging */
rest_len = max_len - last_len;
- merge_len = MIN(udf_rw32(piece->len), rest_len);
+ merge_len = MIN(piece_len, rest_len);
last_end = last_lb_num + (last_len / sector_size);
if ((piece_lb_num == last_end) && (last_part_num == piece_part_num)) {
@@ -773,7 +773,7 @@
{
struct long_ad icb;
uint32_t location;
- uint32_t phys;
+ uint64_t phys;
uint16_t vpart;
uint8_t *bpos;
int cnt, sects;
Home |
Main Index |
Thread Index |
Old Index