diff --git a/.clang-format b/.clang-format index 6a8f79df2..1fe188d2b 100644 --- a/.clang-format +++ b/.clang-format @@ -4,6 +4,8 @@ AllowShortFunctionsOnASingleLine: None AlwaysBreakAfterReturnType: None BasedOnStyle: Webkit BreakBeforeBinaryOperators: NonAssignment +BreakAdjacentStringLiterals: true +AlwaysBreakBeforeMultilineStrings: true ColumnLimit: 80 IndentPPDirectives: BeforeHash NamespaceIndentation: None diff --git a/src/game/savegame/savegame_bson.c b/src/game/savegame/savegame_bson.c index 48365d158..fd7f7d2d9 100644 --- a/src/game/savegame/savegame_bson.c +++ b/src/game/savegame/savegame_bson.c @@ -1347,8 +1347,9 @@ bool Savegame_BSON_LoadFromFile(MYFILE *fp, GAME_INFO *game_info) if (!Savegame_BSON_LoadResumeInfo( json_object_get_array(root_obj, "current_info"), game_info->current)) { - LOG_WARNING("Failed to load RESUME_INFO current properly. Checking if " - "save is legacy."); + LOG_WARNING( + "Failed to load RESUME_INFO current properly. " + "Checking if save is legacy."); // Check for 2.6 and 2.7 legacy start and end info. if (!Savegame_BSON_LoadDiscontinuedStartInfo( json_object_get_array(root_obj, "start_info"), game_info)) { @@ -1433,8 +1434,9 @@ bool Savegame_BSON_LoadOnlyResumeInfo(MYFILE *fp, GAME_INFO *game_info) if (!Savegame_BSON_LoadResumeInfo( json_object_get_array(root_obj, "current_info"), game_info->current)) { - LOG_WARNING("Failed to load RESUME_INFO current properly. Checking if " - "save is legacy."); + LOG_WARNING( + "Failed to load RESUME_INFO current properly. Checking if " + "save is legacy."); // Check for 2.6 and 2.7 legacy start and end info. if (!Savegame_BSON_LoadDiscontinuedStartInfo( json_object_get_array(root_obj, "start_info"), game_info)) { diff --git a/src/game/sound.c b/src/game/sound.c index 6007dc57c..23c8c1cf8 100644 --- a/src/game/sound.c +++ b/src/game/sound.c @@ -489,8 +489,8 @@ void Sound_ResetEffects(void) int32_t mode = s->flags & 3; if (mode == SOUND_MODE_AMBIENT) { if (m_AmbientLookupIdx >= MAX_AMBIENT_FX) { - Shell_ExitSystem("Ran out of ambient fx slots in " - "Sound_ResetEffects()"); + Shell_ExitSystem( + "Ran out of ambient fx slots in Sound_ResetEffects()"); } m_AmbientLookup[m_AmbientLookupIdx] = i; m_AmbientLookupIdx++; diff --git a/src/specific/s_fmv.c b/src/specific/s_fmv.c index 02e8db1f5..27f1624c1 100644 --- a/src/specific/s_fmv.c +++ b/src/specific/s_fmv.c @@ -575,14 +575,13 @@ static int S_FMV_DecoderDecodeFrame(Decoder *d, AVFrame *frame, AVSubtitle *sub) : (d->pkt->data ? AVERROR(EAGAIN) : AVERROR_EOF); } av_packet_unref(d->pkt); + } else if (avcodec_send_packet(d->avctx, d->pkt) == AVERROR(EAGAIN)) { + LOG_ERROR( + "Receive_frame and send_packet both returned EAGAIN, " + "which is an API violation."); + d->packet_pending = true; } else { - if (avcodec_send_packet(d->avctx, d->pkt) == AVERROR(EAGAIN)) { - LOG_ERROR("Receive_frame and send_packet both returned EAGAIN, " - "which is an API violation."); - d->packet_pending = true; - } else { - av_packet_unref(d->pkt); - } + av_packet_unref(d->pkt); } } }