Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Formatting 'char' types (core).

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.80
diff -u -r1.80 ChangeLog
--- ChangeLog 17 Dec 2002 19:56:22 -0000 1.80
+++ ChangeLog 17 Dec 2002 21:50:27 -0000
@@ -1,4 +1,9 @@
 2002-12-17 Mikhail Khodjaiants
+ Formatting 'char' types.
+ * CValue.java
+ * CModificationVariable.java
+
+2002-12-17 Mikhail Khodjaiants
  The core support of the prompting source locator.
  * ICSourceLocator.java
  * CDebugTarget.java
Index: src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java,v
retrieving revision 1.7
diff -u -r1.7 CModificationVariable.java
--- src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java 2 Dec 2002 23:22:22 -0000 1.7
+++ src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java 17 Dec 2002 21:50:27 -0000
@@ -9,6 +9,7 @@
 import java.text.MessageFormat;
 
 import org.eclipse.cdt.debug.core.cdi.CDIException;
+import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
 import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
 import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
 import org.eclipse.cdt.debug.core.model.ICValue;
@@ -139,7 +140,7 @@
    requestFailed( "Unable to set value.", null );
    return null;
   }
-  if ( value.getType() == ICValue.TYPE_CHAR )
+  if ( value.getType() == ICValue.TYPE_CHAR && getFormat() == ICDIFormat.NATURAL )
   {
    char[] chars = oldExpression.toCharArray();
    if ( chars.length != 1 )
Index: src/org/eclipse/cdt/debug/internal/core/model/CValue.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java,v
retrieving revision 1.13
diff -u -r1.13 CValue.java
--- src/org/eclipse/cdt/debug/internal/core/model/CValue.java 17 Dec 2002 02:41:32 -0000 1.13
+++ src/org/eclipse/cdt/debug/internal/core/model/CValue.java 17 Dec 2002 21:50:27 -0000
@@ -289,27 +289,33 @@
  
  private String getCharValue( String value )
  {
-  char result = '.';
+  String result = "";
   int index = value.indexOf( ' ' );
   if ( index > 0 )
   {
+   char resultChar = '.';
    try
    {
     short shortValue = Short.parseShort( value.substring( 0, index ), 10 );
     if ( shortValue >= 0 )
     {
-     result = (char)shortValue;
-     if ( Character.isISOControl( result ) )
+     resultChar = (char)shortValue;
+     if ( Character.isISOControl( resultChar ) )
      {
-      result = '.';
+      resultChar = '.';
      }
     }
    }
    catch( NumberFormatException e )
    {
    }
+   result = String.valueOf( resultChar );
   }
-  return String.valueOf( result );
+  else
+  {
+   result = value;
+  }
+  return result;
  }
  
  protected CVariable getParentVariable()

Back to the top