示例#1
0
文件: coin.c 项目: hydra/freewpc
/** Handle the Nth coin slot switch. */
static void do_coin (U8 slot)
{
	/* Ignore coins after slam tilt */
	if (nonball_event_did_follow (sw_slam_tilt, sw_coin))
		return;

	add_units (price_config.coin_units[slot]);
	audit_increment (&system_audits.coins_added[slot]);
}
示例#2
0
bool RseObtainAskForHelp::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
    ::google::protobuf::uint32 tag;
    while ((tag = input->ReadTag()) != 0) {
        switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // repeated .Items items = 1;
        case 1: {
            if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
                    ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
                goto handle_uninterpreted;
            }
parse_items:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                    input, add_items()));
            if (input->ExpectTag(10)) goto parse_items;
            if (input->ExpectTag(18)) goto parse_units;
            break;
        }

        // repeated .Units units = 2;
        case 2: {
            if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
                    ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
                goto handle_uninterpreted;
            }
parse_units:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                    input, add_units()));
            if (input->ExpectTag(18)) goto parse_units;
            if (input->ExpectAtEnd()) return true;
            break;
        }

        default: {
handle_uninterpreted:
            if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
                    ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
                return true;
            }
            DO_(::google::protobuf::internal::WireFormat::SkipField(
                    input, tag, mutable_unknown_fields()));
            break;
        }
        }
    }
    return true;
#undef DO_
}