mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
80c5fc5701
commit
9e52a24ce4
5 changed files with 14 additions and 22 deletions
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX - Initial API and implementation
|
* QNX - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom.db;
|
package org.eclipse.cdt.internal.core.pdom.db;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -19,15 +18,12 @@ import org.eclipse.core.runtime.Status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class DBStatus extends Status {
|
public class DBStatus extends Status {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param exception
|
* @param exception
|
||||||
*/
|
*/
|
||||||
public DBStatus(IOException exception) {
|
public DBStatus(IOException exception) {
|
||||||
super(IStatus.ERROR, CCorePlugin.PLUGIN_ID, 0, "IOException", exception); //$NON-NLS-1$
|
super(IStatus.ERROR, CCorePlugin.PLUGIN_ID, 0, "IOException", exception); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom.db;
|
package org.eclipse.cdt.internal.core.pdom.db;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom.db;
|
package org.eclipse.cdt.internal.core.pdom.db;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
|
@ -47,8 +46,8 @@ public class LongString implements IString {
|
||||||
}
|
}
|
||||||
|
|
||||||
public LongString(Database db, final char[] chars, boolean useBytes) throws CoreException {
|
public LongString(Database db, final char[] chars, boolean useBytes) throws CoreException {
|
||||||
final int numChars1 = useBytes ? NUM_CHARS1*2 : NUM_CHARS1;
|
final int numChars1 = useBytes ? NUM_CHARS1 * 2 : NUM_CHARS1;
|
||||||
final int numCharsn = useBytes ? NUM_CHARSN*2 : NUM_CHARSN;
|
final int numCharsn = useBytes ? NUM_CHARSN * 2 : NUM_CHARSN;
|
||||||
|
|
||||||
this.db = db;
|
this.db = db;
|
||||||
this.record = db.malloc(Database.MAX_MALLOC_SIZE);
|
this.record = db.malloc(Database.MAX_MALLOC_SIZE);
|
||||||
|
@ -67,7 +66,7 @@ public class LongString implements IString {
|
||||||
// write the subsequent records
|
// write the subsequent records
|
||||||
long lastNext = this.record + NEXT1;
|
long lastNext = this.record + NEXT1;
|
||||||
int start = numChars1;
|
int start = numChars1;
|
||||||
while (length-start > numCharsn) {
|
while (length - start > numCharsn) {
|
||||||
long nextRecord = db.malloc(Database.MAX_MALLOC_SIZE);
|
long nextRecord = db.malloc(Database.MAX_MALLOC_SIZE);
|
||||||
db.putRecPtr(lastNext, nextRecord);
|
db.putRecPtr(lastNext, nextRecord);
|
||||||
chunk= db.getChunk(nextRecord);
|
chunk= db.getChunk(nextRecord);
|
||||||
|
@ -115,9 +114,9 @@ public class LongString implements IString {
|
||||||
long p = record;
|
long p = record;
|
||||||
Chunk chunk= db.getChunk(p);
|
Chunk chunk= db.getChunk(p);
|
||||||
if (useBytes) {
|
if (useBytes) {
|
||||||
chunk.getCharsFromBytes(p+CHARS1, chars, 0, numChars1);
|
chunk.getCharsFromBytes(p + CHARS1, chars, 0, numChars1);
|
||||||
} else {
|
} else {
|
||||||
chunk.getChars(p+CHARS1, chars, 0, numChars1);
|
chunk.getChars(p + CHARS1, chars, 0, numChars1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int start= numChars1;
|
int start= numChars1;
|
||||||
|
@ -129,12 +128,12 @@ public class LongString implements IString {
|
||||||
int partLen= Math.min(length-start, numCharsn);
|
int partLen= Math.min(length-start, numCharsn);
|
||||||
chunk= db.getChunk(p);
|
chunk= db.getChunk(p);
|
||||||
if (useBytes) {
|
if (useBytes) {
|
||||||
chunk.getCharsFromBytes(p+CHARSN, chars, start, partLen);
|
chunk.getCharsFromBytes(p + CHARSN, chars, start, partLen);
|
||||||
} else {
|
} else {
|
||||||
chunk.getChars(p+CHARSN, chars, start, partLen);
|
chunk.getChars(p + CHARSN, chars, start, partLen);
|
||||||
}
|
}
|
||||||
start+= partLen;
|
start += partLen;
|
||||||
p=p+NEXTN;
|
p=p + NEXTN;
|
||||||
}
|
}
|
||||||
return chars;
|
return chars;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +200,7 @@ public class LongString implements IString {
|
||||||
chars = getChars();
|
chars = getChars();
|
||||||
final int len = chars.length;
|
final int len = chars.length;
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
h = 31*h + chars[i];
|
h = 31 * h + chars[i];
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
}
|
}
|
||||||
|
@ -235,7 +234,6 @@ public class LongString implements IString {
|
||||||
return ShortString.comparePrefix(getChars(), other, caseSensitive);
|
return ShortString.comparePrefix(getChars(), other, caseSensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getString() throws CoreException {
|
public String getString() throws CoreException {
|
||||||
return new String(getChars());
|
return new String(getChars());
|
||||||
|
|
|
@ -16,8 +16,7 @@ import java.util.ResourceBundle;
|
||||||
public class Messages {
|
public class Messages {
|
||||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.db.messages"; //$NON-NLS-1$
|
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.db.messages"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
|
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
|
||||||
.getBundle(BUNDLE_NAME);
|
|
||||||
|
|
||||||
private Messages() {
|
private Messages() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* For marshalling types to byte arrays.
|
* For marshalling types to byte arrays.
|
||||||
*/
|
*/
|
||||||
public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
public class TypeMarshalBuffer implements ITypeMarshalBuffer {
|
||||||
public final static byte [] EMPTY= {0,0,0,0,0,0};
|
public final static byte[] EMPTY= { 0, 0, 0, 0, 0, 0 };
|
||||||
public final static byte NULL_TYPE= 0;
|
public final static byte NULL_TYPE= 0;
|
||||||
public final static byte INDIRECT_TYPE= (byte) -1;
|
public final static byte INDIRECT_TYPE= (byte) -1;
|
||||||
public final static byte BINDING_TYPE= (byte) -2;
|
public final static byte BINDING_TYPE= (byte) -2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue