Style fixes, update copyright, add myself as author.

No functional change.
This commit is contained in:
John Scipione
2012-08-03 04:27:12 -04:00
parent e19488b2cc
commit 9f5d4ecd97
15 changed files with 53 additions and 56 deletions
+6 -4
View File
@@ -1,13 +1,15 @@
/*
* Copyright 2006-2011 Haiku, Inc. All Rights Reserved.
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
* John Scipione, [email protected]
* Timothy Wayper <[email protected]>
*/
#include "CalcApplication.h"
#include <stdlib.h>
@@ -22,9 +24,11 @@
#include "CalcWindow.h"
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "CalcApplication"
static const char* kSettingsFileName = "DeskCalc_settings";
const char* kAppSig = "application/x-vnd.Haiku-DeskCalc";
@@ -154,5 +158,3 @@ CalcApplication::_InitSettingsFile(BFile* file, bool write)
return ret;
}
+1 -4
View File
@@ -2,14 +2,11 @@
* Copyright 2006 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
*/
#ifndef _CALC_APPLICATION_H
#define _CALC_APPLICATION_H
#include <Application.h>
+4 -2
View File
@@ -1,13 +1,15 @@
/*
* Copyright 2006-2009 Haiku, Inc. All Rights Reserved.
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
* John Scipione, [email protected]
* Timothy Wayper <[email protected]>
*/
#include "CalcOptions.h"
#include <stdlib.h>
+3 -6
View File
@@ -1,18 +1,15 @@
/*
* Copyright 2006-2009 Haiku, Inc. All Rights Reserved.
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
*/
#ifndef CALC_OPTIONS_H
#define CALC_OPTIONS_H
#include <SupportDefs.h>
enum {
KEYPAD_MODE_COMPACT,
KEYPAD_MODE_BASIC,
+2 -1
View File
@@ -4,9 +4,10 @@
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
* Philippe Saint-Pierre, [email protected]
* John Scipione, [email protected]
* Timothy Wayper <[email protected]>
*/
+2 -5
View File
@@ -2,17 +2,14 @@
* Copyright 2006 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
*/
#ifndef _CALC_VIEW_H
#define _CALC_VIEW_H
#include <View.h>
enum {
MSG_OPTIONS_AUTO_NUM_LOCK = 'oanl',
MSG_OPTIONS_AUDIO_FEEDBACK = 'oafb',
+4 -2
View File
@@ -1,13 +1,15 @@
/*
* Copyright 2006-2011 Haiku, Inc. All Rights Reserved.
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
* John Scipione, [email protected]
* Timothy Wayper <[email protected]>
*/
#include "CalcWindow.h"
#include <stdlib.h>
+3 -7
View File
@@ -2,18 +2,14 @@
* Copyright 2006 Haiku, Inc. All Rights Reserved.
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Timothy Wayper <[email protected]>
* Stephan Aßmus <[email protected]>
*/
#ifndef _CALC_WINDOW_H
#define _CALC_WINDOW_H
#include <Window.h>
class CalcView;
class CalcWindow : public BWindow {
@@ -21,7 +17,7 @@ class CalcWindow : public BWindow {
CalcWindow(BRect frame, BMessage* settings);
virtual ~CalcWindow();
virtual void MessageReceived(BMessage* message);
virtual void MessageReceived(BMessage* message);
virtual void Show();
virtual bool QuitRequested();
+2
View File
@@ -8,11 +8,13 @@
* Stephan Aßmus <[email protected]>
*/
#include <stdio.h>
#include "CalcApplication.h"
#include "ExpressionParser.h"
int
main(int argc, char* argv[])
{
+1 -1
View File
@@ -12,7 +12,7 @@ resource app_version {
internal = 1,
short_info = "DeskCalc",
long_info = "DeskCalc ©2006-2011 Haiku, Inc."
long_info = "DeskCalc ©2006-2012 Haiku, Inc."
};
resource app_flags B_SINGLE_LAUNCH;
+7 -1
View File
@@ -4,8 +4,10 @@
*
* Authors:
* Stephan Aßmus <[email protected]>
* John Scipione, [email protected]
*/
#include "ExpressionTextView.h"
#include <new>
@@ -16,6 +18,7 @@
#include "CalcView.h"
using std::nothrow;
static const int32 kMaxPreviousExpressions = 20;
@@ -270,9 +273,11 @@ ExpressionTextView::SetValue(BString value)
for (; offset >= firstDigit; offset--) {
if (value[offset] == '.')
continue;
digit = (int)(value[offset]) - '0' + 1; // ascii to int + 1
if (digit != 10)
break;
value[offset] = '0';
}
if (digit == 10) {
@@ -287,6 +292,7 @@ ExpressionTextView::SetValue(BString value)
offset = value.FindFirst('E');
if (offset == B_ERROR)
offset = value.CountChars();
value.Truncate(--offset);
offset--; // offset now points to the last digit
@@ -301,6 +307,7 @@ ExpressionTextView::SetValue(BString value)
offset = value.FindFirst('E');
if (offset == B_ERROR)
offset = value.CountChars();
offset--;
}
}
@@ -444,4 +451,3 @@ ExpressionTextView::SaveSettings(BMessage* archive) const
}
return B_OK;
}
+2 -4
View File
@@ -1,19 +1,17 @@
/*
* Copyright 2006 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Stephan Aßmus <[email protected]>
*/
#ifndef EXPRESSION_TEXT_VIEW_H
#define EXPRESSION_TEXT_VIEW_H
#include <List.h>
#include <String.h>
#include "InputTextView.h"
class CalcView;
class ExpressionTextView : public InputTextView {
+1
View File
@@ -6,6 +6,7 @@
* Stephan Aßmus <[email protected]>
*/
#include "InputTextView.h"
#include <stdio.h>
+3 -7
View File
@@ -1,17 +1,15 @@
/*
* Copyright 2006 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Stephan Aßmus <[email protected]>
*/
#ifndef INPUT_TEXT_VIEW_H
#define INPUT_TEXT_VIEW_H
#include <Invoker.h>
#include <TextView.h>
class InputTextView : public BTextView, public BInvoker {
public:
InputTextView(BRect frame,
@@ -35,7 +33,7 @@ class InputTextView : public BTextView, public BInvoker {
virtual void RevertChanges() = 0;
virtual void ApplyChanges() = 0;
protected:
protected:
// BTextView
virtual void Select(int32 start, int32 finish);
@@ -52,5 +50,3 @@ protected:
};
#endif // INPUT_TEXT_VIEW_H
+2 -2
View File
@@ -18,8 +18,8 @@ Application DeskCalc :
;
DoCatalogs DeskCalc :
x-vnd.Haiku-DeskCalc
:
x-vnd.Haiku-DeskCalc
:
CalcApplication.cpp
CalcView.cpp
CalcWindow.cpp