Final 0.6.11 version; only trivial changes

This commit is contained in:
srs5694
2010-09-25 20:39:52 -04:00
parent 5a081757ea
commit ab4b043839
11 changed files with 36 additions and 21 deletions

9
NEWS
View File

@@ -1,5 +1,10 @@
0.6.11 (??/??/2010):
--------------------
0.6.11 (9/25/2010):
-------------------
- Added -F (--first-aligned-in-largest) option to sgdisk. This option is a
variant on -f (--first-in-largest); it returns the number of the first
sector that will be used in the largest free area, given the current
alignment value (set via -a/--set-alignment).
- Streamlined GUID code entry in gdisk; it no longer offers the option
to enter GUIDs in separate segments.

View File

@@ -180,8 +180,8 @@ bool Attributes::OperateOnAttributes(const uint32_t partNum, const string& attri
// display a single attribute
case ao_get: {
cout << partNum+1 << ":" << bitNum << ":" <<
bool (attributeBitMask & attributes) << endl;
cout << partNum+1 << ":" << bitNum << ":"
<< bool (attributeBitMask & attributes) << endl;
break;
} // case ao_get

View File

@@ -1,11 +1,11 @@
Summary: An fdisk-like partitioning tool for GPT disks
Name: gdisk
Version: 0.6.10
Version: 0.6.11
Release: 1%{?dist}
License: GPLv2
URL: http://www.rodsbooks.com/gdisk
Group: Applications/System
Source: http://www.rodsbooks.com/gdisk/gdisk-0.6.10.tgz
Source: http://www.rodsbooks.com/gdisk/gdisk-0.6.11.tgz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
@@ -40,5 +40,5 @@ rm -rf $RPM_BUILD_ROOT
%doc %{_mandir}/man8*
%changelog
* Sun Aug 22 2010 R Smith <rodsmith@rodsbooks.com> - 0.6.10
- Created spec file for 0.6.10 release
* Sat Sep 25 2010 R Smith <rodsmith@rodsbooks.com> - 0.6.11
- Created spec file for 0.6.11 release

View File

@@ -1,6 +1,6 @@
.\" Copyright 2010 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "GDISK" "8" "0.6.10" "Roderick W. Smith" "GPT fdisk Manual"
.TH "GDISK" "8" "0.6.11" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
gdisk \- Interactive GUID partition table (GPT) manipulator
.SH "SYNOPSIS"

View File

@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
device = new char[255];
junk = fgets(device, 255, stdin);
if (device[0] != '\n') {
i = strlen(device);
i = (int) strlen(device);
if (i > 0)
if (device[i - 1] == '\n')
device[i - 1] = '\0';
@@ -412,7 +412,7 @@ void ExpertsMenu(string filename, GPTDataTextUI* theGPT) {
device = new char[255];
junk = fgets(device, 255, stdin);
if (device[0] != '\n') {
i = strlen(device);
i = (int) strlen(device);
if (i > 0)
if (device[i - 1] == '\n')
device[i - 1] = '\0';

2
gpt.cc
View File

@@ -2191,7 +2191,7 @@ void GPTData::SetAlignment(uint32_t n) {
// Returns the computed alignment value.
uint32_t GPTData::ComputeAlignment(void) {
uint32_t i = 0, found, exponent = 31;
uint64_t align = DEFAULT_ALIGNMENT;
uint32_t align = DEFAULT_ALIGNMENT;
exponent = (uint32_t) log2(DEFAULT_ALIGNMENT);
for (i = 0; i < numParts; i++) {

2
gpt.h
View File

@@ -16,7 +16,7 @@
#ifndef __GPTSTRUCTS
#define __GPTSTRUCTS
#define GPTFDISK_VERSION "0.6.11-pre3"
#define GPTFDISK_VERSION "0.6.11"
// Constants used by GPTData::PartsToMBR(). MBR_EMPTY must be the lowest-
// numbered value to refer to partition numbers. (Most will be 0 or positive,

View File

@@ -106,7 +106,7 @@ void GPTPart::SetName(const string & theName) {
junk = fgets(newName, NAME_SIZE / 2, stdin);
// Input is likely to include a newline, so remove it....
i = strlen(newName);
i = (int) strlen(newName);
if ((i > 0) && (i <= NAME_SIZE))
if (newName[i - 1] == '\n')
newName[i - 1] = '\0';

View File

@@ -24,7 +24,7 @@
using namespace std;
GUIDData::GUIDData(void) {
srand(time(0));
srand((unsigned int) time(0));
Zero();
} // constructor

View File

@@ -1,6 +1,6 @@
.\" Copyright 2010 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "SGDISK" "8" "0.6.10" "Roderick W. Smith" "GPT fdisk Manual"
.TH "SGDISK" "8" "0.6.11" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
.SH "SYNOPSIS"
@@ -235,7 +235,17 @@ sectors are available, this function returns the value 0.
Displays the sector number of the start of the largest available block of
sectors on the disk. A script may store this value and pass it back as
part of \fI\-n\fR's option to create a partition. If no unallocated
sectors are available, this function returns the value 0.
sectors are available, this function returns the value 0. Note that this
parameter is blind to partition alignment; when you actually create a
partition, its start point might be changed from this value.
.TP
.B \-F, \-\-first\-aligned\-in\-largest
Similar to \fI\-f\fR (\fI\-\-first\-in\-largest\fR), except returns the
sector number with the current alignment correction applied. Use this
function if you need to compute the actual partition start point rather
than a theoretical start point or the actual start point if you set the
alignment value to 1.
.TP
.B \-g, \-\-mbrtogpt

View File

@@ -251,10 +251,10 @@ uint64_t GetInt(const string & argument, int itemNum) {
while (itemNum-- > 0) {
startPos = endPos + 1;
endPos = argument.find(':', startPos);
endPos = (int) argument.find(':', startPos);
}
if (endPos == (int) string::npos)
endPos = argument.length();
endPos = (int) argument.length();
endPos--;
istringstream inString(argument.substr(startPos, endPos - startPos + 1));
@@ -268,10 +268,10 @@ string GetString(const string & argument, int itemNum) {
while (itemNum-- > 0) {
startPos = endPos + 1;
endPos = argument.find(':', startPos);
endPos = (int) argument.find(':', startPos);
}
if (endPos == (int) string::npos)
endPos = argument.length();
endPos = (int) argument.length();
endPos--;
return argument.substr(startPos, endPos - startPos + 1);