HexEdit/CalcDlg.cpp
void CCalcDlg::check_for_error()
{
	if (state_ > CALCINTLIT) return;

	// Check we have not overflowed bits (if we don't already have an error)
	if (state_ >= CALCINTRES &&
		bits_ > 0 &&                                // can't overflow infinite bits (bits_ == 0)
		(current_ < min_val_ || current_ > max_val_))
	{
		state_ = CALCOVERFLOW;
	}

	if (state_ == CALCERROR)
	{
		make_noise("Calculator Error");
		AvoidableTaskDialog(IDS_CALC_ERROR, (CString)current_str_);
		//mm_->StatusBarText();
		aa_->mac_error_ = 10;
	}
	else if (state_ == CALCOVERFLOW)
	{
		make_noise("Calculator Overflow");
		AvoidableTaskDialog(IDS_CALC_OVERFLOW,
			"The last operation overflowed the current number of bits.\n\n"
				"The displayed result was adjusted for the current settings.\n"
				"To see the complete result please adjust the display settings.",
			"The current calculator value is too large (either positive or negative) or "
				"it is a large negative value and the current settings are for unsigned values.\n\n"
				"To see the full result modify the \"Bits\" and/or \"Signed\" settings, or simply "
				"use \"Inf\" for infinite precision (Bits = 0) to display any value without overflow."
			);
		//mm_->StatusBarText("Overflow");
		aa_->mac_error_ = 2;
	}
}
// Displays errors and aslo checks for overflow (integer literals).
// Should be called after a calculation that could generate and error or overflow
// (unary or binary operation) or when an integer literal has been changed (edited or 
// set from memory etc) or the way it is displayed could cause overflow (bits/signed).

Displays errors and aslo checks for overflow (integer literals).
Should be called after a calculation that could generate and error or overflow
(unary or binary operation) or when an integer literal has been changed (edited or
set from memory etc) or the way it is displayed could cause overflow (bits/signed).
Displays errors and aslo checks for overflow ( integer literals ) . Should be called after a calculation that could generate and error or overflow ( unary or binary operation ) or when an integer literal has been changed ( edited or set from memory etc ) or the way it is displayed could cause overflow ( bits / signed ) .
void CCalcDlg::check_for_error()
{
	if (state_ > CALCINTLIT) return;
	if (state_ >= CALCINTRES &&
		bits_ > 0 &&                                
		(current_ < min_val_ || current_ > max_val_))
	{
		state_ = CALCOVERFLOW;
	}
	if (state_ == CALCERROR)
	{
		make_noise("Calculator Error");
		AvoidableTaskDialog(IDS_CALC_ERROR, (CString)current_str_);
		aa_->mac_error_ = 10;
	}
	else if (state_ == CALCOVERFLOW)
	{
		make_noise("Calculator Overflow");
		AvoidableTaskDialog(IDS_CALC_OVERFLOW,
			"The last operation overflowed the current number of bits.\n\n"
				"The displayed result was adjusted for the current settings.\n"
				"To see the complete result please adjust the display settings.",
			"The current calculator value is too large (either positive or negative) or "
				"it is a large negative value and the current settings are for unsigned values.\n\n"
				"To see the full result modify the \"Bits\" and/or \"Signed\" settings, or simply "
				"use \"Inf\" for infinite precision (Bits = 0) to display any value without overflow."
			);
		aa_->mac_error_ = 2;
	}
}
void CCalcDlg :: check_for_error ( ) { if ( state_ > CALCINTLIT ) return ; if ( state_ >= CALCINTRES && bits_ > 0 && ( current_ < min_val_ || current_ > max_val_ ) ) { state_ = CALCOVERFLOW ; } if ( state_ == CALCERROR ) { make_noise ( " " ) ; AvoidableTaskDialog ( IDS_CALC_ERROR , ( CString ) current_str_ ) ; aa_ -> mac_error_ = 10 ; } else if ( state_ == CALCOVERFLOW ) { make_noise ( " " ) ; AvoidableTaskDialog ( IDS_CALC_OVERFLOW , " \n \n " " \n " " " , " " " \n \n " " \" \" \" \" " " \" \" " ) ; aa_ -> mac_error_ = 2 ; } }
Displays errors and aslo checks for overflow (integer literals).
Displays errors and aslo checks for overflow ( integer literals ) .
// Check we have not overflowed bits (if we don't already have an error)
 // can't overflow infinite bits (bits_ == 0)
 //mm_->StatusBarText();
 //mm_->StatusBarText("Overflow");
